|
6 | 6 | """ |
7 | 7 | from __future__ import unicode_literals, print_function, with_statement |
8 | 8 |
|
9 | | -__version__ = '1.0.4' |
| 9 | +__version__ = '1.1.0' |
10 | 10 |
|
11 | 11 | import os |
12 | 12 | import sys |
|
18 | 18 | from .compat import ( |
19 | 19 | str, bytes, |
20 | 20 | ZIP64_VERSION, |
21 | | - ZIP_BZIP2, BZIP2_VERSION, |
| 21 | + ZIP_BZIP2, BZIP2_VERSION, |
22 | 22 | ZIP_LZMA, LZMA_VERSION) |
23 | 23 |
|
24 | 24 | from zipfile import ( |
25 | | - ZIP_STORED, ZIP64_LIMIT, ZIP_FILECOUNT_LIMIT, ZIP_MAX_COMMENT, |
26 | | - ZIP_DEFLATED, |
| 25 | + ZIP_STORED, ZIP64_LIMIT, ZIP_FILECOUNT_LIMIT, ZIP_MAX_COMMENT, |
| 26 | + ZIP_DEFLATED, |
27 | 27 | structCentralDir, structEndArchive64, structEndArchive, structEndArchive64Locator, |
28 | 28 | stringCentralDir, stringEndArchive64, stringEndArchive, stringEndArchive64Locator, |
29 | 29 | structFileHeader, stringFileHeader, |
30 | 30 | zlib, crc32) |
31 | 31 |
|
32 | | -stringDataDescriptor = b'PK\x07\x08' # magic number for data descriptor |
| 32 | +stringDataDescriptor = b'PK\x07\x08' # magic number for data descriptor |
33 | 33 |
|
34 | 34 |
|
35 | 35 | def _get_compressor(compress_type): |
36 | 36 | if compress_type == ZIP_DEFLATED: |
37 | | - return zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, |
38 | | - zlib.DEFLATED, -15) |
| 37 | + return zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, -15) |
39 | 38 | elif compress_type == ZIP_BZIP2: |
40 | 39 | from zipfile import bz2 |
41 | 40 | return bz2.BZ2Compressor() |
@@ -328,7 +327,7 @@ def __close(self): |
328 | 327 | return |
329 | 328 |
|
330 | 329 | try: |
331 | | - if self.mode in ('w', 'a') and self._didModify: # write ending records |
| 330 | + if self.mode in ('w', 'a') and self._didModify: # write ending records |
332 | 331 | count = 0 |
333 | 332 | pos1 = self.fp.tell() |
334 | 333 | for zinfo in self.filelist: # write central directory |
|
0 commit comments