Error submitting script if I close python window first

Bug #944401 reported by Richard Stanton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Andreas Roehler

Bug Description

I'm using the latest trunk version of python-mode (March 1, 2012) under OS X, with ipython as my shell. If I open a python script and press C-c C-c, a new ipython buffer is created and the script runs fine, though the ipython buffer replaces the original script buffer, rather than the window splitting into two, which means I now need to manually switch buffers to get back to the script file. I think this counts as inconvenient behavior, if not an actual bug...

The more serious problem is as follows. After running the program as above,

1) Ask Emacs to kill the *IPython* buffer and agree to kill the running python process.

2) Return to the original script file buffer and press C-c C-c again

A new ipython buffer is created OK, but the script file doesn't run. Instead, here's what I see:

# executing /var/folders/zf/bgjm4tvs3wv_6q7_6z3b2nx00000gn/T/IPython73387MuA.py...
Enthought Python Distribution -- www.enthought.com

Python 2.7.2 |EPD 7.2-2 (64-bit)| (default, Sep 7 2011, 16:31:15)
Type "copyright", "credits" or "license" for more information.

IPython 0.12 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]: ---------------------------------------------------------------------------
IOError Traceback (most recent call last)
/Users/stanton/projects/RHSlib/python/RHS/finance/<ipython-input-1-d7805c0d90ce> in <module>()
----> 1 execfile(r'/var/folders/zf/bgjm4tvs3wv_6q7_6z3b2nx00000gn/T/IPython73387MuA.py') # PYTHON-MODE

IOError: [Errno 2] No such file or directory: '/var/folders/zf/bgjm4tvs3wv_6q7_6z3b2nx00000gn/T/IPython73387MuA.py'

In [2]:

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 944401] [NEW] Error submitting script if I close python window first

Am 01.03.2012 23:33, schrieb Richard Stanton:
> Public bug reported:
>
> I'm using the latest trunk version of python-mode (March 1, 2012) under
> OS X, with ipython as my shell. If I open a python script and press C-c
> C-c, a new ipython buffer is created and the script runs fine, though
> the ipython buffer replaces the original script buffer, rather than the
> window splitting into two, which means I now need to manually switch
> buffers to get back to the script file. I think this counts as
> inconvenient behavior, if not an actual bug...
>

it is.

Made

https://bugs.launchpad.net/python-mode/+bug/944681

for this.

thanks

Changed in python-mode:
importance: Undecided → Medium
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.0.6
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Am 01.03.2012 23:33, schrieb Richard Stanton:
> Public bug reported:
>
> I'm using the latest trunk version of python-mode (March 1, 2012) under
> OS X, with ipython as my shell. If I open a python script and press C-c
> C-c, a new ipython buffer is created and the script runs fine, though
> the ipython buffer replaces the original script buffer, rather than the
> window splitting into two, which means I now need to manually switch
> buffers to get back to the script file. I think this counts as
> inconvenient behavior, if not an actual bug...
>
> The more serious problem is as follows. After running the program as
> above,
>
> 1) Ask Emacs to kill the *IPython* buffer and agree to kill the running
> python process.
>
> 2) Return to the original script file buffer and press C-c C-c again
>
> A new ipython buffer is created OK, but the script file doesn't run.

if you repeat the command, it should.

First time, if no shell is running, it fails: That bug exists for long,
also mentioned in python.el.

Tried to cure that already, however not successful so far.
That's why python-mode opens a shell already from start - see
`py-start-run-py-shell'

will take another look into though...

Revision history for this message
Richard Stanton (a-stanton) wrote : RE: [Bug 944401] [NEW] Error submitting script if I close python window first

> > The more serious problem is as follows. After running the program as
> > above,
> >
> > 1) Ask Emacs to kill the *IPython* buffer and agree to kill the
> > running python process.
> >
> > 2) Return to the original script file buffer and press C-c C-c again
> >
> > A new ipython buffer is created OK, but the script file doesn't run.
>
> if you repeat the command, it should.

It does. Thanks.

Changed in python-mode:
status: New → Triaged
Revision history for this message
Andreas Roehler (a-roehler) wrote :

please re-open should you still experience it

Changed in python-mode:
status: Triaged → Fix Committed
Revision history for this message
Richard Stanton (a-stanton) wrote :

Same problem, I'm afraid

In [1]: ---------------------------------------------------------------------------
IOError Traceback (most recent call last)
c:\projects\RHSlib\python\RHS\finance\<ipython-input-1-5a7a4493ac1b> in <module>()
----> 1 execfile(r'c:/Users/stanton/AppData/Local/Temp/IPython7088liB.py') # PYTHON-MODE

IOError: [Errno 2] No such file or directory: 'c:/Users/stanton/AppData/Local/Temp/IPython7088liB.py'

In [2]:

Changed in python-mode:
status: Fix Committed → In Progress
Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 944401] Re: Error submitting script if I close python window first

Am 06.03.2012 22:34, schrieb Richard Stanton:
> Same problem, I'm afraid
>
> In [1]: ---------------------------------------------------------------------------
> IOError Traceback (most recent call last)
> c:\projects\RHSlib\python\RHS\finance\<ipython-input-1-5a7a4493ac1b> in<module>()
> ----> 1 execfile(r'c:/Users/stanton/AppData/Local/Temp/IPython7088liB.py') # PYTHON-MODE
>
> IOError: [Errno 2] No such file or directory:
> 'c:/Users/stanton/AppData/Local/Temp/IPython7088liB.py'
>
> In [2]:
>
> ** Changed in: python-mode
> Status: Fix Committed => In Progress
>

please try with a larger py-ipython-execute-delay - 1 second or so.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

get it here too

Revision history for this message
Andreas Roehler (a-roehler) wrote :

works here meanwhile, please re-open if not at you, thanks

Changed in python-mode:
status: In Progress → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.