New submission from Amund Hov: 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. ---------- messages: 248022 nosy: Amund Hov priority: normal severity: normal status: open title: zipimporter masks import errors type: behavior versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24792> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com