Message 336363 - Python tracker (original) (raw)
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.