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.

Author belopolsky
Recipients belopolsky, ncoghlan
Date 2008-12-03.23:58:22
SpamBayes Score 9.544183e-06
Marked as misclassified No
Message-id <d38f5330812031558v11e61071rdffd2ee3559c3385@mail.gmail.com>
In-reply-to <1228337496.39.0.289790222368.issue4201@psf.upfronthosting.co.za>
Content
No, I only used __main__.py to make it easy to reproduce the problem.
Pdb will not be able to access code in any module with a custom
__loader__.  For example, if you move f() to foo.py inside test.zip
and import it from __main__, you will see the same issue.  My patch
gives linecache.getlines() called by Pdb access to module's globs and
thus to its __loader__ .  It has nothing to do with runpy.

> The problem is actually with runpy not being able to set __file__
> correctly, rather than being pdb specific.

You must be thinking issue4197 where two distinct problems are
adressed:  first, the crash due to __file__ set to None by runpy and
second, missing globs parameter to linecache.getlines() in doctest
module.

My patch, doctest-1.patch works around the first issue and fixes the second.
History
Date User Action Args
2008-12-03 23:58:24belopolskysetrecipients: + belopolsky, ncoghlan
2008-12-03 23:58:23belopolskylinkissue4201 messages
2008-12-03 23:58:22belopolskycreate