You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow open() 'name' parameter to be a ZipInfo object, which allows opening archive members with duplicate filenames. Also allow read() 'name' parameter to be a ZipInfo object, as it calls open() directly.
I got sent a zip file which had duplicate names in it, and the only way I could see to extract it using zipfile.py was to apply this patch.
The infolist() and namelist() methods will return information for duplicate filenames, but the open() method takes only a name.
This patch also updated the docs for zipfile.py.
Python 2.1 -> 2.5 zipfile.py module does not have an open() method, but it would be trivial to backport this patch to enhance the read() method.
In the patch you commented "why is 'filepos' computed next? It's never
referenced." The answer is that back at r54152 (bpo-1121142) the method was
rewrote removing any reference to 'filepos', but the patch author failed
to remove that line. Please remove it.