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 vstinner
Recipients brett.cannon, ncoghlan, vstinner
Date 2015-03-18.00:58:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426640296.98.0.079062899559.issue23696@psf.upfronthosting.co.za>
In-reply-to
Content
To work on the issue #23694, I refactored the C function _Py_fopen_obj() to raise an exception on error. I noticed the that zipimport replaces the current exception with ZipImportError.

Attached patch chains the ZipImportError to the OSError to provide more context on error. For example, you can see in the unit test that ZipImportError was caused by a permission error.

Is it ok to require ZipImport.__context__ to be an OSError in the unit test? Can it be added to "zipimport spec"? If not, the test may be splitted to only check __context__ in a test decorated with @cpython_only.
History
Date User Action Args
2015-03-18 00:58:17vstinnersetrecipients: + vstinner, brett.cannon, ncoghlan
2015-03-18 00:58:16vstinnersetmessageid: <1426640296.98.0.079062899559.issue23696@psf.upfronthosting.co.za>
2015-03-18 00:58:16vstinnerlinkissue23696 messages
2015-03-18 00:58:16vstinnercreate