[Python-Dev] Relative path in co_filename for zipped modules (original) (raw)
R. David Murray rdmurray at bitdance.com
Tue Jun 25 22:19:57 CEST 2013
- Previous message: [Python-Dev] Relative path in co_filename for zipped modules
- Next message: [Python-Dev] Relative path in co_filename for zipped modules
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Please file this as a bug report on bugs.python.org so that it doesn't get lost.
See also http://bugs.python.org/issue13328 (which looks like a different bug but could also be causing you problems).
--David
On Wed, 26 Jun 2013 00:11:04 +0400, Vitaly Murashev <vitaly.murashev at gmail.com> wrote:
Dear Python developers community,
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 debugging 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/myzippedmodule.zip/subdir/testmodule.py' but realy it looks like 'full-path-to-current-dir/subdir/testmodule.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.formatstackentry() + Bdb.canonic() Please take a look at the following line inside 'formatstackentry' method: filename = self.canonic(frame.fcode.cofilename) For zipped module variable 'frame.fcode.cofilename' holds relative file path started from the root of zip archive like 'subdir/testmodule.py' And as result Bdb.canonic() method gives what we have - 'full-path-to-current-dir/subdir/testmodule.py' --- So my final question. Could anyone confirm that it is a bug in python core subsystem which one is responsible for loading zipped modules, or something is wrong with my zipped module ? If it is a bug could you please submit it into official python bugtracker ? I never did it before and afraid to do something wrong. Thanks, Vitaly Murashev
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/rdmurray%40bitdance.com
- Previous message: [Python-Dev] Relative path in co_filename for zipped modules
- Next message: [Python-Dev] Relative path in co_filename for zipped modules
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]