msg75197 - (view) |
Author: Alexander Belopolsky (belopolsky) *  |
Date: 2008-10-24 22:52 |
With attached test.zip and svn revision 67006, $ ./python.exe test.zip > /Users/sasha/Work/python-svn/trunk/test.zip/__main__.py(2)f() (Pdb) l [EOF] With pdb.patch: $ ./python.exe test.zip > /Users/sasha/Work/python-svn/trunk/test.zip/__main__.py(2)f() -> pass (Pdb) l 1 def f(): 2 -> pass 3 4 import pdb 5 pdb.runcall(f) 6 7 [EOF] |
|
|
msg76838 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2008-12-03 20:51 |
Just to confirm - this is specific to __main__.py right? The problem is actually with runpy not being able to set __file__ correctly, rather than being pdb specific. |
|
|
msg76854 - (view) |
Author: Alexander Belopolsky (belopolsky) *  |
Date: 2008-12-03 23:58 |
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 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. |
|
|
msg76858 - (view) |
Author: Alexander Belopolsky (belopolsky) *  |
Date: 2008-12-04 00:34 |
Off-topic: How to report a bug tracker bug? The e-mail I sent in response to Nick's post started with: """ On Wed, Dec 3, 2008 at 3:51 PM, Nick Coghlan <report@bugs.python.org> wrote: > Just to confirm - this is specific to __main__.py right? > No, I only used __main__.py to make it easy to reproduce the problem. ... """ But the first two lines got eaten by the tracker. Should I open an issue here and if so, what do I set as a component? |
|
|
msg76878 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2008-12-04 10:44 |
Issues with the tracker itself go in the meta tracker (see the "Report Tracker Problem" link at the bottom of the left hand navigation menu). It's a separate tracker in order to handle cases where the main tracker is actually down in addition to problems with the functionality. And you're right that the get_filename() limitation is only part of the story rather than all of it (for both this and other issues). I'll still try to look at them all in one go this weekend though. |
|
|
msg77512 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2008-12-10 08:57 |
The patch hasn't been accepted for the trunk, yet, so it is out of scope for 2.5.3. Retargetting. |
|
|
msg77784 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2008-12-14 10:56 |
Fixed for 2.7 in r67750. Will be ported to 2.6, 3.0 and 3.1. |
|
|
msg77792 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2008-12-14 12:11 |
Final revisions for fix: 2.7 = r67751 (there was a new test file missing from the initial checkin) 2.6 = r67752 3.1 = r67753 3.0 = r67754 |
|
|