[issue14099] zipfile: ZipFile.open() should not reopen the underlying file

2012-02-23 Thread Stepan Kasal
New submission from Stepan Kasal ka...@ucw.cz: When a file inside a zip is open, the underlying zip file is open again. (Unless the file name is unknown, because the ZipFile object was created with fp only.) This design is incorrect, insecure, and ineffective: - the reopen uses the same string

[issue14099] zipfile: ZipFile.open() should not reopen the underlying file

2012-02-23 Thread Matej Cepl
Changes by Matej Cepl mc...@redhat.com: -- nosy: +mcepl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14099 ___ ___ Python-bugs-list mailing list

[issue14099] zipfile: ZipFile.open() should not reopen the underlying file

2012-02-23 Thread Stepan Kasal
Stepan Kasal ka...@ucw.cz added the comment: Attached please find a patch that fixes this issue by reusing the original fp from ZipFile object. Two of the test cases attempted to read a file from a zip as soon as write() was called. I believe that this is not correct usage: zip file is not