[New-bugs-announce] [issue12247] Finding subprocess.py depends on how IDLE is opened

George Patterson report at bugs.python.org
Fri Jun 3 00:49:06 CEST 2011


New submission from George Patterson <geopascway at gmail.com>:

I'm uncertain this is a bug, but it seems persistent over several machines and I can't figure out where the issue lies.

Most of my troubleshooting has been on a MacBook Pro with Mac OS X version 10.6.7. I have a simple python script 'test.py':

  import subprocess
  subprocess.Popen(['xterm'])

If I run this script by opening it in IDLE using the mouse, it crashes. If I run the same script in an IDLE that I launch by typing 'idle' in a terminal, it doesn't crash. What's going on?  Is this a bug? Or am I just doing something terribly wrong?
Obviously, my interest is not in running this simple script, but it contains the minimum part of the real script which reproduces the error.  

I've repeated this error on one machine(MacBook Pro with Mac OS X version 10.6.7) using either of two versions of Python, 2.6.6 or 2.7.1.  On one machine(Mac Pro OS X version 10.6.7) using Python 2.6.6, on two other machines(IMacs with either OS X version 10.6.7 or 10.6.5) using Python 2.7.1.  I include below only the info for the 2.7.1.

Python 2.7.1 was the 32-bit version Mac OS X 32-bit i386/PPC Installer (2.7.1) for Mac OS X 10.3 through 10.6 [2] (sig) from here (http://www.python.org/download/releases/2.7.1/).



Details: 


1.  Launch IDLE by right clicking test.py and "open with" IDLE (2.7.1).  I "run module".  Pasted below are the contents from the Python Shell.  Included at the bottom is the sys.path for IDLE opened in this manner.
I've also find this error if I open the IDLE located in Applications/Python 2.7/ and then open "test.py" and run it.


Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) 
[GCC 4.0.1 (Apple Inc. build 5494)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 

Traceback (most recent call last):
  File "/Users/georgepatterson/test.py", line 2, in <module>
    subprocess.Popen(['xterm'])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
    errread, errwrite)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
>>> import sys
>>> for p in sys.path: print p

/Users/georgepatterson
/Users/georgepatterson/Documents
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
>>> 




2.  Type "idle" in a terminal window.  Open test.py and "run module".
When run in this manner, the terminal window is opened properly.  I've pasted the contents of the Python Shell below with the sys.path also. 
In case it matters, "which idle" at the terminal prompt points here
/Library/Frameworks/Python.framework/Versions/2.7/bin/idle



Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) 
[GCC 4.0.1 (Apple Inc. build 5494)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 
>>> import sys
>>> for p in sys.path: print p

/Users/georgepatterson
/Library/Frameworks/Python.framework/Versions/2.7/bin
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
>>>

----------
components: IDLE
messages: 137497
nosy: George.Patterson
priority: normal
severity: normal
status: open
title: Finding subprocess.py depends on how IDLE is opened
type: crash
versions: Python 2.6, Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12247>
_______________________________________


More information about the New-bugs-announce mailing list