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 vmurashev
Recipients vmurashev
Date 2013-06-26.14:27:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1372256829.94.0.0966099631525.issue18307@psf.upfronthosting.co.za>
In-reply-to
Content
Recently I found out that it not possible to debug python code if it is a part of zip-module.
Python version being used is 3.3.0

Well known GUI debuggers like Eclipse+PyDev or PyCharm are unable to start debugging and give the following warning:
---
pydev debugger: CRITICAL WARNING: This version of python seems to be incorrectly compiled (internal generated filenames are not absolute)
pydev debugger: The debugger may still function, but it will work slower and may miss breakpoints.
---
So I started my own investigation of this issue and results are the following.
At first I took traditional python debugger 'pdb' to analyze how it behaves during debug of zipped module.
'pdb' showed me some backtaces and filename part for stack entries looks malformed.
I expected something like 'full-path-to-zip-dir/my_zipped_module.zip/subdir/test_module.py'
but realy it looks like 'full-path-to-current-dir/subdir/test_module.py'

Source code in pdb.py and bdb.py (which one are a part of python stdlib) gave me the answer why it happens.

The root cause are inside Bdb.format_stack_entry() + Bdb.canonic()

Please take a look at the following line inside 'format_stack_entry' method:
    filename = self.canonic(frame.f_code.co_filename)

For zipped module variable 'frame.f_code.co_filename' holds _relative_ file path started from the root of zip archive like 'subdir/test_module.py'
And as relult Bdb.canonic() method gives what we have - 'full-path-to-current-dir/subdir/test_module.py'
---
Looks like it is a bug in:
- in python core subsystem which one is responsible for loading zipped modules
- or in pdb debugger
History
Date User Action Args
2013-06-26 14:27:09vmurashevsetrecipients: + vmurashev
2013-06-26 14:27:09vmurashevsetmessageid: <1372256829.94.0.0966099631525.issue18307@psf.upfronthosting.co.za>
2013-06-26 14:27:09vmurashevlinkissue18307 messages
2013-06-26 14:27:09vmurashevcreate