Message75308
Thanks, Jean-Paul, I can now reproduce your problem and I think I found
the culprit.
I believe the file name check in linecache.updatecache is unnecessary
and is responsible for this problem. With the following patch:
--- Lib/linecache.py (revision 67040)
+++ Lib/linecache.py (working copy)
@@ -88,7 +88,7 @@
get_source = getattr(loader, 'get_source', None)
if name and get_source:
- if basename.startswith(name.split('.')[-1]+'.'):
+# if basename.startswith(name.split('.')[-1]+'.'):
try:
data = get_source(name)
except (ImportError, IOError):
and Jean-Paul's foobar:
$ PYTHONPATH=/tmp/foobar.zip ./python.exe -c "import inspect,foobar;
print inspect.getsource(foobar)"
def foo(): pass
Martin, is there a chance for this issue and #4197, #4201 to make it
to 2.5.3? If so, I'll prepare a combined patch with tests for your
consideration shortly. |
|
Date |
User |
Action |
Args |
2008-10-28 22:47:00 | belopolsky | set | recipients:
+ belopolsky, loewis, exarkun, gpolo |
2008-10-28 22:47:00 | belopolsky | set | messageid: <1225234020.41.0.982262119532.issue4223@psf.upfronthosting.co.za> |
2008-10-28 22:46:59 | belopolsky | link | issue4223 messages |
2008-10-28 22:46:58 | belopolsky | create | |
|