[issue36088] zipfile cannot handle zip in zip

2019-02-22 Thread Liyu Gong


New submission from Liyu Gong :

Suppose a.zip is z zip file containing 'abc/def/1.txt'

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

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

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

works well. Is it a known issue?

Thanks!

--
files: a.zip
messages: 336356
nosy: liyugong
priority: normal
severity: normal
status: open
title: zipfile cannot handle zip in zip
versions: Python 3.6
Added file: https://bugs.python.org/file48164/a.zip

___
Python tracker 
<https://bugs.python.org/issue36088>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36088] zipfile cannot handle zip in zip

2019-02-22 Thread Liyu Gong


Liyu Gong  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 
<https://bugs.python.org/issue36088>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36088] zipfile cannot handle zip in zip

2019-02-22 Thread Liyu Gong


Liyu Gong  added the comment:

add a.tar

--
Added file: https://bugs.python.org/file48166/a.tar

___
Python tracker 
<https://bugs.python.org/issue36088>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36088] zipfile cannot handle zip in zip

2019-02-22 Thread Liyu Gong


Change by Liyu Gong :


Removed file: https://bugs.python.org/file48164/a.zip

___
Python tracker 
<https://bugs.python.org/issue36088>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com