Message248022
Due to mixed version .pyc files in my zipped python application I was getting inconsistent loading of certain packages.
E.g.
n [4]: zf.find_module('kitconsole')
Out[4]: <zipimporter object "test_controller_test.zip">
In [5]: zf.load_module('kitconsole')
---------------------------------------------------------------------------
ZipImportError Traceback (most recent call last)
<ipython-input-5-8e75885cc952> in <module>()
----> 1 zf.load_module('kitconsole')
ZipImportError: can't find module 'kitconsole'
Unpacking the archive and doing the import from the file system revealed the real issue, ImportError: Bad Magic Number.
As an end user it was confusing that zipimporter reported being able to find the module in find_module(), but not in load_module(). Is it possible to have load_module provide a better error message when import fails? The wording now does not give any hints when searching the bug-tracker / Google. |
|
Date |
User |
Action |
Args |
2015-08-05 08:51:03 | Amund Hov | set | recipients:
+ Amund Hov |
2015-08-05 08:51:02 | Amund Hov | set | messageid: <1438764662.95.0.423222705195.issue24792@psf.upfronthosting.co.za> |
2015-08-05 08:51:02 | Amund Hov | link | issue24792 messages |
2015-08-05 08:51:01 | Amund Hov | create | |
|