This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezyang
Recipients ezyang
Date 2012-04-08.19:01:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1333911683.02.0.244330903259.issue14531@psf.upfronthosting.co.za>
In-reply-to
Content
When generating a backtrace from an interactive Python session (e.g. the input is from <stdin>, Python attempts to actually find a file named <stdin>, to somewhat hilarious consequences.

See the strace'd Python session below:

>>> foo
open("/etc/default/apport", O_RDONLY|O_LARGEFILE) = 3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
open("<stdin>", O_RDONLY|O_LARGEFILE)   = -1 ENOENT (No such file or directory)
open("<stdin>", O_RDONLY|O_LARGEFILE)   = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/pylint-0.24.0-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/logilab_astng-0.22.0-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/logilab_common-0.56.1-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/unittest2-0.5.1-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/gitdb-0.5.4-py2.7-linux-i686.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/smmap-0.8.1-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/async-0.6.1-py2.7-linux-i686.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/decorator-3.3.1-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.7.2-py2.7-linux-i686.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/Sphinx-1.0.7-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/docutils-0.8.1-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/Jinja2-2.6-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/Pygments-1.4-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/nose-1.1.2-py2.7.egg/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/ezyang/Dev/6.02/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/ezyang/Dev/pyafs/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/ezyang/Dev/wizard/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/ezyang/Dev/twisted/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/site-packages/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/ezyang/Work/shared-python/build/lib.linux-i686-2.6/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/ezyang/Work/snarfs/python/coil/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/ezyang/Dev/py-github/src/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/plat-linux2/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/lib-tk/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/lib-old/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/lib-dynload/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.7/dist-packages/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/Numeric/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/PIL/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/gst-0.10/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/gtk-2.0/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/pymodules/python2.7/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/pymodules/python2.7/libubuntuone/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/ubuntu-sso-client/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/ubuntuone-client/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/ubuntuone-control-panel/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/ubuntuone-couch/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/ubuntuone-installer/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/<stdin>", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
NameError: name 'foo' is not defined
>>>
History
Date User Action Args
2012-04-08 19:01:23ezyangsetrecipients: + ezyang
2012-04-08 19:01:23ezyangsetmessageid: <1333911683.02.0.244330903259.issue14531@psf.upfronthosting.co.za>
2012-04-08 19:01:22ezyanglinkissue14531 messages
2012-04-08 19:01:22ezyangcreate