Message238368
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. |
|
Date |
User |
Action |
Args |
2015-03-18 00:58:17 | vstinner | set | recipients:
+ vstinner, brett.cannon, ncoghlan |
2015-03-18 00:58:16 | vstinner | set | messageid: <1426640296.98.0.079062899559.issue23696@psf.upfronthosting.co.za> |
2015-03-18 00:58:16 | vstinner | link | issue23696 messages |
2015-03-18 00:58:16 | vstinner | create | |
|