[issue36088] zipfile cannot handle zip in zip

Liyu Gong report at bugs.python.org
Sat Feb 23 00:26:52 EST 2019


Liyu Gong <gongliyu at gmail.com> added the comment:

Sorry, I made a mistake. I retested on the following content

a.zip ==>  abc/def/1.zip

zf = zipfile.ZipFile('a.zip')
memf = zf.open('abc/def/1.zip', 'r')
zf2 = zipfile.ZipFile(memf) 

will raise an error. However, when a.zip is a tar file containing 'abc/def/1.zip', the following codes

a.tar ===> abc/def/1.zip

tf = tarfile.open('a.tar')
memf = tf.extractfile('abc/def/1.zip')
zf2 = zipfile.ZipFile(memf)

works well. 

Since only one file can be uploaded, I will try to upload the tar file on the next post.

----------
status: pending -> open
Added file: https://bugs.python.org/file48165/a.zip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36088>
_______________________________________


More information about the Python-bugs-list mailing list