Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdb losing __file__ #46272

Closed
erno mannequin opened this issue Jan 31, 2008 · 2 comments
Closed

pdb losing __file__ #46272

erno mannequin opened this issue Jan 31, 2008 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@erno
Copy link
Mannequin

erno mannequin commented Jan 31, 2008

BPO 1980
Nosy @tiran

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-01-31.13:29:53.855>
created_at = <Date 2008-01-31.11:19:13.479>
labels = ['library']
title = 'pdb losing __file__'
updated_at = <Date 2008-01-31.13:29:53.850>
user = 'https://bugs.python.org/erno'

bugs.python.org fields:

activity = <Date 2008-01-31.13:29:53.850>
actor = 'christian.heimes'
assignee = 'none'
closed = True
closed_date = <Date 2008-01-31.13:29:53.855>
closer = 'christian.heimes'
components = ['Library (Lib)']
creation = <Date 2008-01-31.11:19:13.479>
creator = 'erno'
dependencies = []
files = []
hgrepos = []
issue_num = 1980
keywords = []
message_count = 2.0
messages = ['61896', '61898']
nosy_count = 2.0
nosy_names = ['christian.heimes', 'erno']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1980'
versions = ['Python 2.5']

@erno
Copy link
Mannequin Author

erno mannequin commented Jan 31, 2008

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.

@erno erno mannequin added the stdlib Python modules in the Lib dir label Jan 31, 2008
@tiran
Copy link
Member

tiran commented Jan 31, 2008

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

@tiran tiran closed this as completed Jan 31, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant