Mercurial > ~astiob > upreckon > hgweb
diff 2.00/zipfile271.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/zipfile271.diff Thu Nov 25 00:03:29 2010 +0000 +++ b/2.00/zipfile271.diff Mon Nov 29 01:24:22 2010 +0000 @@ -1,5 +1,5 @@ ---- ../../zipfile.py 2010-11-24 01:47:05.000000000 +0000 -+++ zipfile271.py 2010-11-24 01:51:31.000000000 +0000 +--- /usr/local/lib/python2.7/zipfile.py 2010-11-29 00:56:38.000000000 +0000 ++++ zipfile271.py 2010-11-29 01:20:17.000000000 +0000 @@ -1,6 +1,7 @@ """ Read and write ZIP files. @@ -31,7 +31,7 @@ # Other ZIP compression methods not supported # Below are some formats and associated data for reading/writing headers using -@@ -477,6 +484,9 @@ +@@ -483,6 +490,9 @@ if self._compress_type == ZIP_DEFLATED: self._decompressor = zlib.decompressobj(-15) @@ -41,7 +41,7 @@ self._unconsumed = '' self._readbuffer = '' -@@ -635,6 +645,13 @@ +@@ -641,6 +651,13 @@ self._update_crc(data, eof=eof) self._readbuffer = self._readbuffer[self._offset:] + data self._offset = 0 @@ -55,7 +55,7 @@ # Read from buffer. data = self._readbuffer[self._offset: self._offset + n] -@@ -651,7 +668,8 @@ +@@ -657,7 +674,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". @@ -65,7 +65,7 @@ allowZip64: if True ZipFile will create files with ZIP64 extensions when needed, otherwise it will raise an exception when this would be necessary. -@@ -671,6 +689,10 @@ +@@ -677,6 +695,10 @@ if not zlib: raise RuntimeError,\ "Compression requires the (missing) zlib module" @@ -76,7 +76,7 @@ else: raise RuntimeError, "That compression method is not supported" -@@ -994,7 +1016,10 @@ +@@ -1011,7 +1033,10 @@ if zinfo.compress_type == ZIP_DEFLATED and not zlib: raise RuntimeError, \ "Compression requires the (missing) zlib module" @@ -88,7 +88,7 @@ raise RuntimeError, \ "That compression method is not supported" if zinfo.file_size > ZIP64_LIMIT: -@@ -1055,6 +1080,8 @@ +@@ -1072,6 +1097,8 @@ if zinfo.compress_type == ZIP_DEFLATED: cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, -15) @@ -97,7 +97,7 @@ else: cmpr = None while 1: -@@ -1115,6 +1142,10 @@ +@@ -1132,6 +1159,10 @@ zlib.DEFLATED, -15) bytes = co.compress(bytes) + co.flush() zinfo.compress_size = len(bytes) # Compressed size