No such file or directory: '/tmp/ipython-....py'

Bug #1445948 reported by Zeitlinie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Incomplete
High
Andreas Roehler

Bug Description

Hi,

with the present python-mode revno: 1842 and vanilla Emacs 24.3.1 I am completely stuck with frequent and erratic occurrence error messages of type

---------------------------------------------------------------------------
IOError Traceback (most recent call last)
<ipython-input-30-f3cf7bacfa68> in <module>()
----> 1 exec(compile(open('/tmp/ipython-5828X6t.py').read(), '/tmp/ipython-5828X6t.py', 'exec')) # PYTHON-MODE

IOError: [Errno 2] No such file or directory: '/tmp/ipython-5828X6t.py'

These errors show up irregularly and very frequently on any set of commands submitted to the interpreter by C-c |
Using emacs and ipython this way is impossible.

Changed in python-mode:
assignee: nobody → Andreas Roehler (a-roehler)
importance: Undecided → High
milestone: none → 6.2.1
Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1445948] [NEW] No such file or directory: '/tmp/ipython-....py'

Am 19.04.2015 um 17:59 schrieb Zeitlinie:
> Public bug reported:
>
> Hi,
>
> with the present python-mode revno: 1842 and vanilla Emacs 24.3.1 I am
> completely stuck with frequent and erratic occurrence error messages of
> type
>
> ---------------------------------------------------------------------------
> IOError Traceback (most recent call last)
> <ipython-input-30-f3cf7bacfa68> in <module>()
> ----> 1 exec(compile(open('/tmp/ipython-5828X6t.py').read(), '/tmp/ipython-5828X6t.py', 'exec')) # PYTHON-MODE
>
> IOError: [Errno 2] No such file or directory: '/tmp/ipython-5828X6t.py'
>
> These errors show up irregularly and very frequently on any set of commands submitted to the interpreter by C-c |
> Using emacs and ipython this way is impossible.
>

Hmm, may you send some example code, which triggers the bug?
All tests pass here so far.

Might be related to virtualenv resp. write-permissions.

Changed in python-mode:
status: New → Incomplete
Revision history for this message
Zeitlinie (zeitlinie) wrote :

There is no 'particular' code which generates this.
It happens on any code.
It happens totally random. The code may work for some time - and then it generates this error in large amounts.
What do you mean by virtualenv?
And where should I look for potential write-permission issues?

Revision history for this message
Zeitlinie (zeitlinie) wrote :

Just to add one more regarding write permissions.
Since it seems as if some files of type '/tmp/ipython-xyz.py' are missing:
my /tmp dir contains some such files ... some of which are also of recent date.
So it seems as if such files can be written into that location.
However it also seems as if not all of the necessary files are there ...
This is beyond me..

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1445948] Re: No such file or directory: '/tmp/ipython-....py'

Am 22.04.2015 um 18:44 schrieb Zeitlinie:
> There is no 'particular' code which generates this.
> It happens on any code.
> It happens totally random.
That would be great. Until now computers couldn't provide randomness :-)

> The code may work for some time - and then it generates this error in large amounts.
> What do you mean by virtualenv?
https://pypi.python.org/pypi/virtualenv

> And where should I look for potential write-permission issues?
>

If not using a virtualenv, we can drop this question and look for at
other places.
I'm going to write a couple of tests aimed at the description, so maybe
it shows up.

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

Am 22.04.2015 um 18:55 schrieb Zeitlinie:
> Just to add one more regarding write permissions.
> Since it seems as if some files of type '/tmp/ipython-xyz.py' are missing:
> my /tmp dir contains some such files ... some of which are also of recent date.
> So it seems as if such files can be written into that location.
> However it also seems as if not all of the necessary files are there ...
> This is beyond me..
>

python-mode.el by defaul uses temporary filest.
However these should be deleted afterwards. Should you see many of them,
it might indicate an other bug.

BTW there is a way to avoid use of temp-files at environments without
write-permission. Which seems not the case here.

Changed in python-mode:
importance: High → Undecided
Revision history for this message
Zeitlinie (zeitlinie) wrote :

> python-mode.el by defaul uses temporary filest.
> However these should be deleted afterwards. Should you see many of them,
> it might indicate an other bug.

Yes, you are right, they get deleted automatically, and my /tmp dir does not contain many, but only 1,2, or lately even 3 of them.

> BTW there is a way to avoid use of temp-files at environments without
> write-permission. Which seems not the case here.

How would I do that anyway?

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

Am 24.04.2015 um 15:55 schrieb Zeitlinie:

> BTW there is a way to avoid use of temp-files at environments without
> write-permission. Which seems not the case here.
> How would I do that anyway?
>

set py-execute-no-temp-p to non-nil

However, it's not recommended.

Revision history for this message
York Zhao (gtdplatform) wrote :

I'm suffering from this exact problem, and it's happening all the time.

Revision history for this message
York Zhao (gtdplatform) wrote :

Forgot to mention that I've tried (setq py-execute-no-temp-p t), but it doesn't help at all.

Revision history for this message
York Zhao (gtdplatform) wrote :

After pulling the latest development bzr version, I no longer have this problem. Thanks a lot!

Revision history for this message
Balu Nadiga (btnadiga) wrote :

I have the same problem as Zeitlinie, and it occurs SPORADICALLY. That is, e.g., when I try executing the same region two times, it may succeed on one attempt and not on the other. Obviously the state may somehow have changed between the two attempts and so it may not be 'random' as such. I have verified that the file in question gets written, but it seems as though it is erased (by python-mode) before it is executed!

Using python-mode 6.2.1

IOError Traceback (most recent call last)
<ipython-input-31-b539482515e8> in <module>()
----> 1 exec(compile(open('/tmp/ipython-18915s8X.py').read(), '/tmp/ipython-18915s8X.py', 'exec')) # PYTHON-MODE

IOError: [Errno 2] No such file or directory: '/tmp/ipython-18915s8X.py'

Changed in python-mode:
importance: Undecided → High
milestone: 6.2.1 → none
Revision history for this message
Andreas Roehler (a-roehler) wrote :

With an error happening randomly as told, fixing will be difficult. Need some glue WRT circumstances. Anyway - will have another look ASAP.

Revision history for this message
Balu Nadiga (btnadiga) wrote :

Dear Andreas,
I'd be very willing to have a chat with you on the phone if that can help you identify and fix this. I'd very much appreciate the fix, because I use emacs and ipython a lot and have been getting frustrated with trying to fix this by using different combinations of versions of emacs, ipython, and python-mode etc... and trying to hack python-mode.el
Thanks

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

  On 12.11.2015 22:33, Balu Nadiga wrote:
> Dear Andreas,
> I'd be very willing to have a chat with you on the phone if that can help you identify and fix this. I'd very much appreciate the fix, because I use emacs and ipython a lot and have been getting frustrated with trying to fix this by using different combinations of versions of emacs, ipython, and python-mode etc... and trying to hack python-mode.el
> Thanks
>

Thanks back. Unfortunately, without having some description WRT to
circumstances that would not help.
Helpful would be valid but failing tests.

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.