Mercurial > ~astiob > upreckon > hgweb
diff 2.00/zipfile313.diff @ 32:3000bb94addb
Updated zipfile to 2.7.1 and 3.1.3 final releases.
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Mon, 29 Nov 2010 01:24:22 +0000 |
parents | a8cc383b787c |
children |
line wrap: on
line diff
--- a/2.00/zipfile313.diff Thu Nov 25 00:03:29 2010 +0000 +++ b/2.00/zipfile313.diff Mon Nov 29 01:24:22 2010 +0000 @@ -1,5 +1,5 @@ ---- ../../zipfile.py 2010-11-24 01:54:28.000000000 +0000 -+++ zipfile313.py 2010-11-24 01:55:17.000000000 +0000 +--- /usr/local/lib/python3.1/zipfile.py 2010-11-29 00:59:28.000000000 +0000 ++++ zipfile313.py 2010-11-29 01:22:19.000000000 +0000 @@ -3,6 +3,7 @@ XXX references to utf-8 need further investigation. @@ -31,7 +31,7 @@ # Other ZIP compression methods not supported # Below are some formats and associated data for reading/writing headers using -@@ -471,6 +478,9 @@ +@@ -477,6 +484,9 @@ self.compreadsize = 64*1024 if self.compress_type == ZIP_DEFLATED: self.dc = zlib.decompressobj(-15) @@ -41,7 +41,7 @@ if hasattr(zipinfo, 'CRC'): self._expected_crc = zipinfo.CRC -@@ -598,7 +608,7 @@ +@@ -604,7 +614,7 @@ if self.compress_type == ZIP_STORED: lr = len(self.readbuffer) bytesToRead = min(bytesToRead, size - lr) @@ -50,7 +50,7 @@ if len(self.readbuffer) > size: # the user has requested fewer bytes than we've already # pulled through the decompressor; don't read any more -@@ -633,14 +643,17 @@ +@@ -639,14 +649,17 @@ newdata = bytes(map(self.decrypter, newdata)) # decompress newly read data if necessary @@ -71,7 +71,7 @@ # prevent decompressor from being used again self.dc = None -@@ -668,7 +681,8 @@ +@@ -674,7 +687,8 @@ file: Either the path to the file, or a file-like object. If it is a path, the file will be opened and closed by ZipFile. mode: The mode can be either read "r", write "w" or append "a". @@ -81,7 +81,7 @@ allowZip64: if True ZipFile will create files with ZIP64 extensions when needed, otherwise it will raise an exception when this would be necessary. -@@ -688,6 +702,10 @@ +@@ -694,6 +708,10 @@ if not zlib: raise RuntimeError( "Compression requires the (missing) zlib module") @@ -92,7 +92,7 @@ else: raise RuntimeError("That compression method is not supported") -@@ -1024,7 +1042,10 @@ +@@ -1041,7 +1059,10 @@ if zinfo.compress_type == ZIP_DEFLATED and not zlib: raise RuntimeError( "Compression requires the (missing) zlib module") @@ -104,7 +104,7 @@ raise RuntimeError("That compression method is not supported") if zinfo.file_size > ZIP64_LIMIT: if not self._allowZip64: -@@ -1085,6 +1106,8 @@ +@@ -1102,6 +1123,8 @@ if zinfo.compress_type == ZIP_DEFLATED: cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, -15) @@ -113,7 +113,7 @@ else: cmpr = None while 1: -@@ -1145,6 +1168,10 @@ +@@ -1162,6 +1185,10 @@ zlib.DEFLATED, -15) data = co.compress(data) + co.flush() zinfo.compress_size = len(data) # Compressed size