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.

classification
Title: pdb fails to launch some script.
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.4, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, romain_jacquet
Priority: normal Keywords:

Created on 2007-10-10 14:02 by romain_jacquet, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bug.py romain_jacquet, 2007-10-10 14:02
Messages (2)
msg56312 - (view) Author: Romain JACQUET (romain_jacquet) Date: 2007-10-10 14:02
Pdb fails to launch any scripts that uses the __file__ builtin.
This problem occurs because pdb does not set the global environnement
correctly.

It can be corrected by setting the global variable __file__ before pdb
executes the file.

Lib/pdb.py:
Replace : globals_ = {"__name__" : "__main__"} 
by: globals_ = {"__name__" : "__main__", "__file__": filename}

The problem happens also in python 2.5.
msg57410 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-12 17:35
Fixed in r58950 for Python 2.5. Python 2.6 and 3k are already fixed.
History
Date User Action Args
2022-04-11 14:56:27adminsetgithub: 45595
2007-11-12 17:35:21christian.heimessetstatus: open -> closed
resolution: fixed
messages: + msg57410
nosy: + christian.heimes
versions: + Python 2.5
2007-10-10 14:02:30romain_jacquetcreate