Martin McNickle <[EMAIL PROTECTED]> added the comment: The mechanism for throwing an error has been written, however for the case of a duplicated filename, it appears to have been deliberatly not been used by the original author.:
def _writecheck(self, zinfo): """Check for errors before writing a file to the archive.""" if zinfo.filename in self.NameToInfo: if self.debug: # Warning for duplicate names print "Duplicate name:", zinfo.filename if self.mode not in ("w", "a"): raise RuntimeError, 'write() requires mode "w" or "a"' ... Putting a 'replace=True' switch seems a little clumsy, it would be much better to raise an error, or allow the user a way to globally control what happens in this case, i.e. overwrite the existing file or drop it. Adding a global behaviour switch seems to be the best way to preserve backwards compatibility. What do people think is the best way? -- Martin ---------- nosy: +BitTorment __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2824> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com