[New-bugs-announce] [issue5668] file "<stdin>" on disk creates garbage output in stack trace

Zbyszek Szmek report at bugs.python.org
Thu Apr 2 12:31:20 CEST 2009


New submission from Zbyszek Szmek <zbyszek at in.waw.pl>:

When running interactively, python checks for existence of file
"<stdin>" when trying to display a stack trace with code input from stdin.

# cat >> "<stdin>"
asdf asdf asdf

# python
Python 2.5.2 (r252:60911, Jun 25 2008, 17:58:32) 
[GCC 4.3.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> asdf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    asdf asdf asdf
NameError: name 'asdf' is not defined

# strace -efile python
...
open("<stdin>", O_RDONLY)               = -1 ENOENT (No such file or
directory)
open("<stdin>", O_RDONLY)               = -1 ENOENT (No such file or
directory)
open("/home13/zbyszek/pm/<stdin>", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/lib/python25.zip/<stdin>", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/usr/lib64/python2.5/<stdin>", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/lib64/python2.5/plat-linux2/<stdin>", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/lib64/python2.5/lib-tk/<stdin>", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/lib64/python2.5/lib-dynload/<stdin>", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/lib64/python2.5/site-packages/<stdin>", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/lib64/python2.5/site-packages/Numeric/<stdin>", O_RDONLY) =
-1 ENOENT (No such file or directory)
open("/usr/lib64/python2.5/site-packages/PIL/<stdin>", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/lib64/python2.5/site-packages/gtk-2.0/<stdin>", O_RDONLY) =
-1 ENOENT (No such file or directory)
open("/usr/lib64/python2.5/site-packages/wx-2.8-gtk2-unicode/<stdin>",
O_RDONLY) = -1 ENOENT (No such file or directory)

This is exactly the same in python 2.4, 2.5 and 3.0. I haven't tested
other versions.

----------
components: Interpreter Core
messages: 85192
nosy: zbysz
severity: normal
status: open
title: file "<stdin>" on disk creates garbage output in stack trace
versions: Python 2.4, Python 2.5, Python 3.0

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


More information about the New-bugs-announce mailing list