From: Dan W. <d4...@ho...> - 2002-10-07 20:53:52
|
Hi, I have found a something strange when using zipfile.ZipFile() with mode="a". The following code illustrates: import zipfile #Open an existing zip file in append mode file = zipfile.ZipFile("c:\\test.zip", mode="a") #Add first file file.write("c:\\test1.txt") #Add second file file.write("c:\\test2.txt") #Close archive file.close() At the end of this, only the file test2.txt exists in the zip. It seems that each file overwrites the last rather than adding to the archive. I have tried this in Python 2.2 and found it works correctly. Also worth noting is that if a zipfile is opened in append mode when it does not exist, Jython creates it, whereas Python raises an IOError. Any insights would be much appreciated. Dan. _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx |