summaryrefslogtreecommitdiffstats
path: root/Lib/gzip.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #2846: Add support for gzip.GzipFile reading zero-padded files.Antoine Pitrou2010-01-131-0/+9
| | | | Patch by Brian Curtin.
* Issue #7471: Improve the performance of GzipFile's buffering mechanism,Antoine Pitrou2010-01-031-57/+42
| | | | | and make it implement the `io.BufferedIOBase` ABC to allow for further speedups by wrapping it in an `io.BufferedReader`. Patch by Nir Aides.
* Issue #4750: Store the basename of the original filename inLars Gustäbel2009-10-291-2/+2
| | | | the gzip FNAME header as required by RFC 1952.
* #4351: more appropriate DeprecationWarning stacklevelsPhilip Jenvey2009-05-081-1/+1
|
* Issue #3860: GzipFile and BZ2File now support the context manager protocol.Antoine Pitrou2009-01-101-0/+8
|
* Issue #4272: Add an optional argument to the GzipFile constructor to ↵Antoine Pitrou2009-01-041-4/+17
| | | | override the timestamp in the gzip stream.
* #2959: allow multiple close() calls for GzipFile.Georg Brandl2008-05-251-0/+2
|
* prevent a warning from the struct module when data size >= 2**32.Gregory P. Smith2008-03-231-1/+1
|
* A bugfix for r61813, it would fail if the data size was >=2**32.Gregory P. Smith2008-03-231-5/+1
|
* Fix gzip to deal with CRC's being signed values in Python 2.x properly and toGregory P. Smith2008-03-231-31/+13
| | | | | | | read 32bit values as unsigned to start with rather than applying signedness fixups allover the place afterwards. This hopefully fixes the test_tarfile failure on the alpha/tru64 buildbot.
* Improve the error message when the CRCs don't match.Gregory P. Smith2008-03-191-1/+2
|
* Strip the '.gz' extension from the filename that is written to theLars Gustäbel2007-02-131-3/+6
| | | | gzip header.
* Patch #1647484: Renamed GzipFile's filename attribute to name. TheLars Gustäbel2007-02-131-8/+13
| | | | | filename attribute is still accessible as a property that emits a DeprecationWarning.
* Patch #1355023: support whence argument for GzipFile.seek.Martin v. Löwis2006-11-121-1/+6
|
* Try to squash struct.pack warnings on the "amd64 gentoo trunk"Tim Peters2006-08-021-1/+7
| | | | | | | | | | | | | | | | | | | | buildbot (& possibly other 64-bit boxes) during test_gzip. The native zlib crc32 function returns an unsigned 32-bit integer, which the Python wrapper implicitly casts to C long. Therefore the same crc can "look negative" on a 32-bit box but "look positive" on a 64-bit box. This patch papers over that platform difference when writing the crc to file. It may be better to change the Python wrapper, either to make the result "look positive" on all platforms (which means it may have to return a Python long at times on a 32-bit box), or to keep the sign the same across boxes. But that would be a visible change in what users see, while the current hack changes no visible behavior (well, apart from stopping the struct deprecation warning). Note that the module-level write32() function is no longer used.
* Apply revised patch for GzipFile.readline performance #1281707Bob Ippolito2006-05-221-16/+21
|
* Revert gzip readline performance patch #1281707 until a more generic ↵Bob Ippolito2006-05-221-28/+20
| | | | performance improvement can be found
* GzipFile.readline performance improvement (~30-40%), patch #1281707Bob Ippolito2006-05-221-20/+28
|
* [Bug #1074261, patch #1074381] Restrict the size of chunks read from the ↵Andrew M. Kuchling2005-06-091-2/+3
| | | | file in order to avoid overflow or huge memory consumption. Patch by Mark Eichin
* Whitespace normalization.Tim Peters2005-03-281-2/+2
|
* Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.Martin v. Löwis2005-03-031-1/+4
| | | | Partially fixes #1110242.
* Ack, removed useless import of os I just introduced.Tim Peters2004-07-271-1/+1
|
* Added a new fileno() method. ZODB's repozo.py wants this so it canTim Peters2004-07-271-1/+9
| | | | apply os.fsync() to the GzipFile backup files it creates.
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-1/+1
| | | | From SF patch #852334.
* Fix error in exception message.Brett Cannon2003-12-041-1/+1
|
* [Patch #654421 from Matthew Mueller]Andrew M. Kuchling2003-02-051-2/+2
| | | | | | | | | gzip shouldn't raise ValueError on corrupt files Currently the gzip module will raise a ValueError if the file was corrupt (bad crc or bad size). I can't see how that applies to reading a corrupt file. IOError seems better, and it's what code will likely be looking for.
* Another round on SF patch 618135: gzip.py and files > 2GTim Peters2002-11-051-4/+9
| | | | | | | | | | The last round boosted "the limit" from 2GB to 4GB. This round gets rid of the 4GB limit. For files > 4GB, gzip stores just the last 32 bits of the file size, and now we play along with that too. Tested by hand (on a 6+GB file) on Win2K. Boosting from 2GB to 4GB was arguably enough "a bugfix". Going beyond that smells more like "new feature" to me.
* Related to SF patch 618135: gzip.py and files > 2G.Tim Peters2002-11-041-18/+34
| | | | | | | | | | | | | | | | Fixed the signed/unsigned confusions when dealing with files >= 2GB. 4GB is still a hard limitation of the gzip file format, though. Testing this was a bitch on Win98SE due to frequent system freezes. It didn't freeze while running gzip, it kept freezing while trying to *create* a > 2GB test file! This wasn't Python's doing. I don't know of a reasonable way to test this functionality in regrtest.py, so I'm not checking in a test case (a test case would necessarily require creating a 2GB+ file first, using gzip to zip it, using gzip to unzip it again, and then compare before-and-after; so >4GB free space would be required, and a loooong time; I did all this "by hand" once). Bugfix candidate, I guess.
* Remove mention of deprecated xreadlines method.Guido van Rossum2002-08-061-1/+1
|
* Patch 560023 adding docstrings. 2.2 Candidate (after verifying modules were ↵Raymond Hettinger2002-05-291-0/+38
| | | | not updated after 2.2).
* force gzip module to open files using 'b'inary mode.Skip Montanaro2002-05-231-0/+4
| | | | closes patch #536278.
* Whitespace normalization.Tim Peters2002-04-161-2/+2
|
* Partial introduction of bools where appropriate.Guido van Rossum2002-04-071-11/+11
|
* Make GzipFile an iterator. Closes bug #532621.Neil Schemenauer2002-03-201-0/+10
|
* Patch #443899: Check modes on files before performing operations.Martin v. Löwis2002-03-111-1/+9
| | | | Use IOErrors where file objects use them.
* "f" should be "self"; reported by Neal Norwitz.Fred Drake2001-10-131-1/+1
|
* Remove redefinition of writelines() methodAndrew M. Kuchling2001-08-131-5/+0
| | | | Remove unused variable and import
* Whitespace normalization.Tim Peters2001-08-091-2/+2
|
* Patch #448474: Add support for tell() and seek() to gzip.GzipFile.Martin v. Löwis2001-08-091-2/+34
|
* Bug #409419: delete seek() and tell() methods, so callers can use getattr()Andrew M. Kuchling2001-03-201-6/+0
| | | | | to check for them (instead of calling them and then ignoring an IOError)
* The code to write timestamps couldn't handle negative times (and timeJack Jansen2001-02-211-0/+2
| | | | on the Mac is negativevalues > 0x80000000). Fixed.
* String method conversion.Eric S. Raymond2001-02-091-5/+5
|
* added a few more __all__ listsSkip Montanaro2001-01-231-0/+2
| | | | fixed typo in ihooks docstring
* Whitespace normalization.Tim Peters2001-01-141-25/+25
|
* SF patch #100740: Add optional size arguments to .readline() andAndrew M. Kuchling2000-07-291-19/+37
| | | | | | .readlines() methods. Inspired by a patch from Wolfgang Grafen, though this version of the patch was completely rewritten from his code.
* if the GzipFile constructor fails, the __del__ method is stillJeremy Hylton2000-05-081-3/+7
| | | | called. catch the resulting AttributeError and exit cleanly.
* Actually, the previous batch's comment should have been different;Guido van Rossum2000-02-041-1/+2
| | | | | | | | | | *this* set of patches is Ka-Ping's final sweep: The attached patches update the standard library so that all modules have docstrings beginning with one-line summaries. A new docstring was added to formatter. The docstring for os.py was updated to mention nt, os2, ce in addition to posix, dos, mac.
* More trivial comment -> docstring transformations by Ka-Ping Yee,Guido van Rossum2000-02-041-6/+6
| | | | | | | | | | | | | | | | | | who writes: Here is batch 2, as a big collection of CVS context diffs. Along with moving comments into docstrings, i've added a couple of missing docstrings and attempted to make sure more module docstrings begin with a one-line summary. I did not add docstrings to the methods in profile.py for fear of upsetting any careful optimizations there, though i did move class documentation into class docstrings. The convention i'm using is to leave credits/version/copyright type of stuff in # comments, and move the rest of the descriptive stuff about module usage into module docstrings. Hope this is okay.
* Make read() and readlines() conform more to the file object interface:Guido van Rossum2000-02-021-3/+3
| | | | | the default arg for read() is -1, not None, and readlines() has an optional argument (which for now is ignored).
* Fixed 'return EOFError' that should be 'raise EOFError', caught byAndrew M. Kuchling1999-09-061-1/+1
| | | | Skip Montanaro's return-value patches.