[issue14531] Backtrace should not attempt to open stdin file

2013-04-20 Thread Martin Morrison

Changes by Martin Morrison m...@ensoft.co.uk:


--
nosy: +isoschiz

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14531
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14531] Backtrace should not attempt to open stdin file

2012-09-06 Thread Ahsan Nawroj

Changes by Ahsan Nawroj ahsan.naw...@gmail.com:


--
nosy: +ainur0160

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14531
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Edward Yang

New submission from Edward Yang ezy...@mit.edu:

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)

[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

That does seem like silly behavior.  On the other hand, the only ill effect is 
likely the time required to execute the series of open calls which, in the 
interactive case, would not even be noticed on most systems.  Would you be 
interested in writing a patch?

--
nosy: +ned.deily
priority: normal - low
stage:  - needs patch
versions: +Python 3.2, Python 3.3 -Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14531
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Edward Yang

Edward Yang ezy...@mit.edu added the comment:

stdin is a valid name of a file on Unix systems. So the fix is not so clear.

ezyang@javelin:~$ python
Python 2.7.2+ (default, Oct  4 2011, 20:03:08) 
[GCC 4.6.1] on linux2
Type help, copyright, credits or license for more information.
 a
Traceback (most recent call last):
  File stdin, line 1, in module
Here’s an idea: when a (multi-variable) calculus course arrives at the 
topic of the *chain rule*, it should use as a worked example the multilayer 
perceptron—a topic you usually only find in an introductory artificial 
intelligence course. In fact, it’s ideal, since the treatment of this topic in 
most AI courses (at this point, I’ve taken two—a byproduct of slightly 
mismatched class schedules when you study abroad) involves *no* extra 
theoretical computer science content whatsoever. If you know the definition of 
a multilayer perceptron, any Calculus student who knows the chain rule should 
be able to work out the back-propagation algorithm—or perhaps I should call it 
a *recurrence.* 
NameError: name 'a' is not defined

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14531
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14531
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

The filename is retrieved from: traceback-frame-f_code-co_filename. 
co_filename is an arbitrary string. Example:

 exec(compile(1+a, /etc/passwd, exec))
Traceback (most recent call last):
  File stdin, line 1, in module
  File /etc/passwd, line 1, in module
root:x:0:0:root:/root:/bin/bash
NameError: name 'a' is not defined

root:x:0:0:root:/root:/bin/bash is the first line of the /etc/passwd file.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14531
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com