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 mchouza
Recipients mchouza
Date 2018-02-26.21:08:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1519679331.45.0.467229070634.issue32959@psf.upfronthosting.co.za>
In-reply-to
Content
When trying to import a module from a ZIP archive containing more than 65535 files, the import process fails:

$ python3 -VV
Python 3.6.4 (default, Jan  6 2018, 11:49:38) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
$ cat create_zips.py 
from zipfile import ZipFile
with ZipFile('below.zip', 'w') as zfp:
    for i in range(65535):
        zfp.writestr('m%d.py' % i, '')
with ZipFile('over.zip', 'w') as zfp:
    for i in range(65536):
        zfp.writestr('m%d.py' % i, '')
$ python3 create_zips.py 
$ python -m zipfile -l below.zip | (head -2 && tail -2)
File Name                                             Modified             Size
m0.py                                          2018-02-26 20:57:32            0
m65533.py                                      2018-02-26 20:57:36            0
m65534.py                                      2018-02-26 20:57:36            0
$ python -m zipfile -l over.zip | (head -2 && tail -2)
File Name                                             Modified             Size
m0.py                                          2018-02-26 20:57:36            0
m65534.py                                      2018-02-26 20:57:40            0
m65535.py                                      2018-02-26 20:57:40            0
$ PYTHONPATH=below.zip python3 -c 'import m0'
$ PYTHONPATH=over.zip python3 -c 'import m0'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'm0'

I think the problem is related to the zipimport module not handling the 'zip64 end of central directory record'.
History
Date User Action Args
2018-02-26 21:08:51mchouzasetrecipients: + mchouza
2018-02-26 21:08:51mchouzasetmessageid: <1519679331.45.0.467229070634.issue32959@psf.upfronthosting.co.za>
2018-02-26 21:08:51mchouzalinkissue32959 messages
2018-02-26 21:08:51mchouzacreate