[issue2824] zipfile to handle duplicate files in archive

anatoly techtonik report at bugs.python.org
Thu Apr 8 09:51:55 CEST 2010


anatoly techtonik <techtonik at gmail.com> added the comment:

On the second thought having a switch for a low-level zip format hacking is a good addition. It may also be used for in-place removals from .zip file by erasing directory entry. Otherwise remove operation will require repacking archive into temporary file, which is too high level and vulnerable to disk space/permission matters.

So, I vote for:
(b) a switch in ZipFile's __init__() that will raise by default
and also because you'd need to modify write() and writestr().

class zipfile.ZipFile(file[, mode[, compression[, allowZip64, [low_level]]]]) 

"""Added in version 2.7: If `low_level` compatibility switch is set (False by default), then ZipFile allows low level operations, such as adding two files with the same name without raising an exception. This is for compatibility with previous versions.""" 

BTW, allowZip64 would be nice to be aliased/deprecated in favor of allow_zip64 for consistency with other double word params in module.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2824>
_______________________________________


More information about the Python-bugs-list mailing list