classification
Title: pdb losing __file__
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, erno
Priority: normal Keywords:

Created on 2008-01-31 11:19 by erno, last changed 2008-01-31 13:29 by christian.heimes. This issue is now closed.

Messages (2)
msg61896 - (view) Author: Erno Kuusela (erno) Date: 2008-01-31 11:19
under pdb, __file__ is not defined when executing a source code file
directly.

for example, if myprogram.py contains "print __file__", a NameError will
be raised when run with python -m pdb myprogram.py.
msg61898 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-01-31 13:29
The issue is already fixed in the 2.5 and 2.6. 2.5.2 is going to be
released in a couple of weeks.

$ python2.5 test.py
> /home/heimes/dev/python/trunk/test.py(4)<module>()
-> print __file__
(Pdb) n
test.py
--Return--
> /home/heimes/dev/python/trunk/test.py(4)<module>()->None
-> print __file__
(Pdb) n
History
Date User Action Args
2008-01-31 13:29:53christian.heimessetstatus: open -> closed
resolution: out of date
messages: + msg61898
nosy: + christian.heimes
2008-01-31 11:19:13ernocreate