summaryrefslogtreecommitdiffstats
path: root/Lib/gzip.py
Commit message (Collapse)AuthorAgeFilesLines
* [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.
* Added __del__ method to GzipFile class that will flush and close theAndrew M. Kuchling1999-08-101-0/+5
| | | | object, if required.
* Two different changes.Guido van Rossum1999-04-121-2/+5
| | | | | | | | | | 1. Jack Jansen reports that on the Mac, the time may be negative, and solves this by adding a write32u() function that writes an unsigned long. 2. On 64-bit platforms the CRC comparison fails; I've fixed this by casting both values to be compared to "unsigned long" i.e. modulo 0x100000000L.
* Oops, missed mode parameter to open().Fred Drake1999-04-051-1/+1
|
* Made the default mode 'rb' instead of 'r', for better cross-platformFred Drake1999-04-051-2/+2
| | | | | support. (Based on comment on the documentation by Bernhard Reiter <bernhard@csd.uwm.edu>).
* Based on a suggestion from bruce@hams.com, make a trivial change toAndrew M. Kuchling1999-03-251-32/+67
| | | | | | | | | | | | | allow using the 'a' flag as a mode for opening a GzipFile. gzip files, surprisingly enough, can be concatenated and then decompressed; the effect is to concatenate the two chunks of data. If we support it on writing, it should also be supported on reading. This *wasn't* trivial, and required rearranging the code in the reading path, particularly the _read() method. Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file' and 'Unknown compression method'
* use struct instead of bit-manipulate in PythonJeremy Hylton1999-03-231-21/+3
|
* Patch by Ron Klatchko: fix invariant in _unread(). Also fixedGuido van Rossum1998-08-031-3/+9
| | | | readlines() to behave like it should (return lines with "\n" appended).
* Fix bug reported by Harri Pasanen: gzip + cPickle doesn't work. TheJeremy Hylton1998-05-131-4/+3
| | | | | | | | | problem was a couple of bugs in the readline implementation. 1. Include the '\n' in the string returned by readline 2. Bug calculating new buffer size in _unread Also remove unncessary import of StringIO
* Mass check-in after untabifying all files that need it.Guido van Rossum1998-03-261-203/+203
|
* (This fix is really by Jeremy)Guido van Rossum1998-01-271-22/+29
| | | | | | | | | | | Here's my suggested replacement for gzip.py for 1.5.1. I've re-implemeted methods readline and readlines, added an _unread, and tweaked read and _read. I tried a more complicated buffer scheme for unread (using a list of strings and string.join), but it was more complicated and slower. This version is a lot faster than the current version and is still pretty simple.
* When there's no filename, don't make one up.Guido van Rossum1997-12-301-6/+54
| | | | | Added _test() that behaves (a bit) like gzip. Fix a comment (*sequential* access is okay -- *random* access it out!)
* Add the option to pass an open file object to GzipFile. This obviatesGuido van Rossum1997-07-191-55/+44
| | | | the need for the StringIO subclass.
* Adding Jeremy Hylton's gzip module.Guido van Rossum1997-04-301-0/+264
This requires Andrew Kuchling's zlib extension module. It still needs some doc strings.