summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
Commit message (Collapse)AuthorAgeFilesLines
* Document that zipfile decryption is insanely slow and fix a typo andGregory P. Smith2008-01-201-1/+1
| | | | | blatant lie in a docstring (it is not useful for security regardless of how you spell it).
* Fix zipfile decryption. The check for validity only worked on oneGregory P. Smith2008-01-201-2/+11
| | | | | | | | type of encrypted zip files. Files using extended local headers needed to compare the check byte against different values. (according to reading the infozip unzip crypt.c source code) Fixes issue1003.
* Fixes/Accepts Patch for issue1189216 - Work properly with archivesGregory P. Smith2008-01-191-2/+2
| | | | that have file headers past the 2**31 byte boundary.
* Fix 1698398: Zipfile.printdir() crashed because the format string expected ↵Raymond Hettinger2008-01-141-2/+2
| | | | a tuple object of length six instead of a time.struct_time object.
* #467924, patch by Alan McIntyre: Add ZipFile.extract and ZipFile.extractall.Georg Brandl2008-01-071-1/+57
|
* Patch #1675424: Added tests for uncovered code in the zipfile module.Georg Brandl2007-07-121-3/+21
| | | | | The KeyError raised by Zipfile.getinfo for nonexistent names now has a descriptive message.
* Whitespace normalization.Tim Peters2007-03-121-14/+14
|
* Patch #1121142: Implement ZipFile.open.Martin v. Löwis2007-03-061-39/+235
|
* Patch #1517891: Make 'a' create the file if it doesn't exist.Martin v. Löwis2007-02-131-1/+8
| | | | Fixes #1514451.
* Patch #698833: Support file decryption in zipfile.Martin v. Löwis2007-02-131-1/+84
|
* ZipFile.close(): Kill the other struct.pack deprecationTim Peters2006-07-311-1/+1
| | | | | | | | | warning on Windows. Afraid I can't detect a pattern to when the pack formats decide to use a signed or unsigned format code -- appears nearly arbitrary to my eyes. So I left all the pack formats alone and changed the special-case data values instead.
* ZipFile.close(): Killed one of the struct.pack deprecationTim Peters2006-07-311-1/+2
| | | | | | | | | | | warnings on Win32. Also added an XXX about the line: pos3 = self.fp.tell() `pos3` is never referenced, and I have no idea what the code intended to do instead.
* Whitespace normalization.Tim Peters2006-06-151-11/+11
|
* Patch #1446489 (zipfile: support for ZIP64)Ronald Oussoren2006-06-151-53/+331
|
* Bug #1413790: zipfile now sanitizes absolute archive names that areGeorg Brandl2006-02-201-3/+5
| | | | not allowed by the specs.
* Patch #1412872: zipfile: use correct system type on unixy systems.Martin v. Löwis2006-02-051-2/+6
|
* Remove dependency on order of mode flagsRaymond Hettinger2005-02-161-1/+1
|
* Don't choke on modes like rb or wb.Raymond Hettinger2004-11-061-1/+1
|
* Make struct formats for specifying file size to be unsigned instead of signedBrett Cannon2004-07-101-4/+4
| | | | | | | | (ZIP file spec. says in section K, "General notes" in point 1 that unless specified otherwise values are unsigned and they are not specified as signed in the spec). Closes bug #679953. Thanks Jimmy Burgett.
* [Bug #835415] AIX can return modes that are >65536, which causes an ↵Andrew M. Kuchling2004-07-101-1/+1
| | | | OverflowError. Fix from Albert Chin
* SF patch #756996: Bare except in ZipFile.testzip()Raymond Hettinger2003-06-271-1/+1
| | | | | | | | | (Contributed by Steven Taschuk) Replaces a bare except that caused all errors to be mis-reported as archive errors. Added a related NEWS item.
* Remove debug print on filename with NUL byte.Greg Ward2003-06-181-1/+0
|
* SF patch #755987 (Jim Ahlstrom):Greg Ward2003-06-181-16/+15
| | | | | | | | | | | | | | | | | This is a patch for Bug 755031: If a null byte appears in a file name, Python zipfile.py retains it, but InfoZip terminates the name. Null bytes in file names are used as a trick by viruses. I tested WinZip, and it also truncates the file name at the null byte. The patch also fixes a buglet: If a zipfile incorrectly uses a directory separator other than '/', there was an invalid complaint that the central directory name does not match the file header name. I also removed my name from the top of the file. It was there for legal reasons which I believe no longer apply. Many people have worked on this file besides me.
* Patch #661719: Expose compilation errors as exceptions on request.Martin v. Löwis2003-01-151-1/+4
|
* Patch #651621, approved by MvL.Just van Rossum2002-12-121-2/+9
| | | | | | | | | | | | | | | | This patch allows ZipFile.writestr() to be called with an archive file name instead of a ZipInfo instance: z = ZipFile("myarchive.zip", "w") z.writestr("foo/baz/file.ext", data) z.close() I found the old writestr() method very inconvenient for simple (but common) things. If called with a file name instead of a ZipInfo instance, the date_time is set to the current date/time, which makes sense to me for anonymous data.
* Patch #611760: read archives with comments.Martin v. Löwis2002-10-131-23/+48
|
* Avoid warnings about <<. external_attr is now an unsigned long.Guido van Rossum2002-08-121-2/+2
|
* Remove uses of the string and types modules:Walter Dörwald2002-06-031-8/+1
| | | | | | | | | | | | | | | | | | | | | | x in string.whitespace => x.isspace() type(x) in types.StringTypes => isinstance(x, basestring) isinstance(x, types.StringTypes) => isinstance(x, basestring) type(x) is types.StringType => isinstance(x, str) type(x) == types.StringType => isinstance(x, str) string.split(x, ...) => x.split(...) string.join(x, y) => y.join(x) string.zfill(x, ...) => x.zfill(...) string.count(x, ...) => x.count(...) hasattr(types, "UnicodeType") => try: unicode except NameError: type(x) != types.TupleTuple => not isinstance(x, tuple) isinstance(x, types.TupleType) => isinstance(x, tuple) type(x) is types.IntType => isinstance(x, int) Do not mention the string module in the rlcompleter docstring. This partially applies SF patch http://www.python.org/sf/562373 (with basestring instead of string). (It excludes the changes to unittest.py and does not change the os.stat stuff.)
* Replaced obsolete stat module constants with equivalent attributesRaymond Hettinger2002-06-011-3/+3
|
* SF 563203. Replaced 'has_key()' with 'in'.Raymond Hettinger2002-06-011-1/+1
|
* Partial introduction of bools where appropriate.Guido van Rossum2002-04-071-1/+2
|
* SF bug #488514: -Qnew needs workTim Peters2001-12-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Big Hammer to implement -Qnew as PEP 238 says it should work (a global option affecting all instances of "/"). pydebug.h, main.c, pythonrun.c: define a private _Py_QnewFlag flag, true iff -Qnew is passed on the command line. This should go away (as the comments say) when true division becomes The Rule. This is deliberately not exposed to runtime inspection or modification: it's a one-way one-shot switch to pretend you're using Python 3. ceval.c: when _Py_QnewFlag is set, treat BINARY_DIVIDE as BINARY_TRUE_DIVIDE. test_{descr, generators, zipfile}.py: fiddle so these pass under -Qnew too. This was just a matter of s!/!//! in test_generators and test_zipfile. test_descr was trickier, as testbinop() is passed assumptions that "/" is the same as calling a "__div__" method; put a temporary hack there to call "__truediv__" instead when the method name is "__div__" and 1/2 evaluates to 0.5. Three standard tests still fail under -Qnew (on Windows; somebody please try the Linux tests with -Qnew too! Linux runs a whole bunch of tests Windows doesn't): test_augassign test_class test_coercion I can't stay awake longer to stare at this (be my guest). Offhand cures weren't obvious, nor was it even obvious that cures are possible without major hackery. Question: when -Qnew is in effect, should calls to __div__ magically change into calls to __truediv__? See "major hackery" at tail end of last paragraph <wink>.
* SF bug 486480: zipfile __del__ is brokenTim Peters2001-11-281-3/+3
| | | | | | ZipFile.__del__(): call ZipFile.close(), like its docstring says it does. ZipFile.close(): allow calling more than once (as all file-like objects in Python should support).
* Make these modules work when Python is compiled without Unicode support.Guido van Rossum2001-09-211-1/+4
|
* Whitespace normalization.Tim Peters2001-09-181-1/+1
|
* [ #458701 ] Patch to zipfile.py for JavaFinn Bock2001-09-051-5/+9
| | | | | Patch by Jim Ahlstrom which lets java's zipfile classes read zipfiles create by zipfile.py.
* Make sure path names inserted into ZIP files are normalized to use "/" asFred Drake2001-07-191-1/+12
| | | | | | the directory separator, as required by the format specification. This closes SF bug #440693.
* Fix one bare except: clause.Fred Drake2001-05-111-1/+1
|
* Mark Favas points out that there's an 'self.fp.flush()' call in theGuido van Rossum2001-04-141-1/+1
| | | | | | ZipFile.close() method that should be part of the preceding 'if' block. On some platforms (Mark noticed this on FreeBSD 4.2) doing a flush() on a file open for reading is not allowed.
* Try an except: after an import into "except ImportError".Guido van Rossum2001-04-101-1/+1
| | | | | | This came out of SF bug #411881. Note that there's another unqualified except: still.
* Sf bug [ #412214 ] ZipFile constructor leaves files open.Tim Peters2001-04-041-0/+14
| | | | | | This applies the patch Fred Drake created to fix it. I'm checking it in since I had to apply the patch anyway in order to test its behavior on Windows.
* Whitespace normalization.Tim Peters2001-03-291-5/+5
|
* Itamar Shtull-Trauring <itamar@maxnm.com>:Fred Drake2001-03-261-8/+31
| | | | | Add support to zipfile to support opening an archive represented by an open file rather than a file name.
* final round of __all__ lists (I hope) - skipped urllib2 because Moshe may beSkip Montanaro2001-03-011-0/+3
| | | | giving it a slight facelift
* Define lots of constants for indexes into the structures for the fileFred Drake2001-02-281-7/+51
| | | | | | | | | | | | | header and central directory structures, and use them as appropriate. The point being to make it easier to tell what is getting pulled out where; magic numbers are evil! Change the computation of the ZipInfo.file_offset field to use the length of the relevant "extra" field -- there are two different ones, and the wrong one had been used. ;-( This closes SF tracker patch #403276, but more verbosely than the proposed patch.
* Fix SF tracker bug #403871: AttributeError in ZipFile.__del__() whenFred Drake2001-02-281-0/+2
| | | | there was an IOError opening the underlying file in ZipFile.__init__().
* Whitespace normalization. Top level of Lib now fixed-point for reindent.py!Tim Peters2001-01-151-59/+59
|
* Delay import of py_compile until needed, since is is only used by theFred Drake2000-10-021-31/+45
| | | | | | | | PyZipFile class. End sentences in docstrings with periods. Reformat docstrings to be more similar to those of other modules.
* Always use the same name for the exception defined in this module!Fred Drake2000-09-291-12/+12
| | | | | | Error reported via email by Pete Shinners <pete@visionart.com>. Fixed some indentation inconsistencies.
* James C. Ahlstron <jim@interet.com>:Fred Drake2000-06-131-1/+1
| | | | Thanks to Hubert Hoegl <hubert.hoegl@dlr.de> for finding this bug.