[issue4197] Doctest module does not work with zipped packages

2008-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: It turns out you were pretty close to pinpointing the problem in doctest, but didn't quite manage to identify which step was going wrong. The problem was actually that even after __file__ was being set correctly, the call to linecache.getlines wasn't being given t

[issue4197] Doctest module does not work with zipped packages

2008-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: I have a test case locally that demonstrates both the missing line number in the __main__.py from a zipfile case, as well as the display of main.c as the filename (the latter is not specific to the zipfile case - it also happens for a normal main module). It stil

[issue4197] Doctest module does not work with zipped packages

2008-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: Re-opening, pending development of a fully passing test specifically for the __main__.py in zipfile case. -- resolution: fixed -> status: closed -> open ___ Python tracker _

[issue4197] Doctest module does not work with zipped packages

2008-12-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Nick, Your commit does not fix the line number reporting from doctest failures: $ ./python.exe testmodule.zip ** File "testmodule.zip/__main__.py", line ?, in __main__.c ... Note the '?

[issue4197] Doctest module does not work with zipped packages

2008-12-14 Thread Nick Coghlan
Nick Coghlan added the comment: 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 -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue4197] Doctest module does not work with zipped packages

2008-12-14 Thread Nick Coghlan
Nick Coghlan added the comment: Fixed for 2.7 in r67750. Will be ported to 2.6, 3.0 and 3.1. ___ Python tracker ___ ___ Python-bugs-list maili

[issue4197] Doctest module does not work with zipped packages

2008-12-10 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: The precise solution still seems to be debated, so this is out of scope for 2.5.3. -- nosy: +loewis versions: -Python 2.5.3 ___ Python tracker <[EMAIL PROTECTED]>

[issue4197] Doctest module does not work with zipped packages

2008-12-03 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: While the patch at issue4512 fixes the crash, it does not fix the line number issue. I would prefer to start with doctest-1.patch like solution because changing the PEP 302 loader protocol by adding get_filename needs additional disc

[issue4197] Doctest module does not work with zipped packages

2008-12-03 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I created issue4512 to implement get_filename extension in zipimport. Will post a patch shortly. ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4197] Doctest module does not work with zipped packages

2008-12-03 Thread Nick Coghlan
Nick Coghlan <[EMAIL PROTECTED]> added the comment: runpy needs a non-standard PEP 302 extension to set __file__ correctly in the modules it runs. The pkgutil stuff it uses to find pure Python modules in the filesystem supports that extension, but zipimport doesn't (yet). ___

[issue4197] Doctest module does not work with zipped packages

2008-12-03 Thread Nick Coghlan
Changes by Nick Coghlan <[EMAIL PROTECTED]>: -- assignee: -> ncoghlan nosy: +ncoghlan ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Py

[issue4197] Doctest module does not work with zipped packages

2008-10-24 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- versions: +Python 2.5.3, Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue4197] Doctest module does not work with zipped packages

2008-10-24 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I don't think there is an easy way to fix source file name reporting without injecting __file__ = '/' into the module namespace is zipimporter, but I don't know if any code relies on __file__ set to None. Setting __file__ to (in the

[issue4197] Doctest module does not work with zipped packages

2008-10-24 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: The next patch, doctest-1.patch addresses the line number issue, but the file name is still wrong. $ ./python.exe testmodule.zip ** File "__main__", line 2, in __main

[issue4197] Doctest module does not work with zipped packages

2008-10-24 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- keywords: +patch Added file: http://bugs.python.org/file11878/doctest.patch ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue4197] Doctest module does not work with zipped packages

2008-10-24 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Attached patch addresses the crash, but two issues remain: $ ./python.exe testmodule.zip ** File "__main__", line ?, in __main__.c Failed example: 'line 2' Expecte

[issue4197] Doctest module does not work with zipped packages

2008-10-24 Thread Alexander Belopolsky
New submission from Alexander Belopolsky <[EMAIL PROTECTED]>: With attached teestmodule.zip and svn revision 67006, $ ./python.exe testmodule.zip Traceback (most recent call last): File "/Users/sasha/Work/python-svn/trunk/Lib/runpy.py", line 121, in _run_module_as_main "__main__", fname,