Commit Graph

59 Commits

Author SHA1 Message Date
Andrew M. Kuchling f4f119c055 Based on a suggestion from bruce@hams.com, make a trivial change to
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'
1999-03-25 21:49:14 +00:00
Jeremy Hylton c19f9972a1 use struct instead of bit-manipulate in Python 1999-03-23 23:05:34 +00:00
Guido van Rossum 84c6fc9653 Patch by Ron Klatchko: fix invariant in _unread(). Also fixed
readlines() to behave like it should (return lines with "\n" appended).
1998-08-03 15:41:39 +00:00
Jeremy Hylton ee918cb487 Fix bug reported by Harri Pasanen: gzip + cPickle doesn't work. The
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
1998-05-13 21:49:58 +00:00
Guido van Rossum 45e2fbc2e7 Mass check-in after untabifying all files that need it. 1998-03-26 21:13:24 +00:00
Guido van Rossum b16a3b8450 (This fix is really by Jeremy)
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.
1998-01-27 19:29:45 +00:00
Guido van Rossum 51ca6e3e42 When there's no filename, don't make one up.
Added _test() that behaves (a bit) like gzip.
Fix a comment (*sequential* access is okay -- *random* access it out!)
1997-12-30 20:09:08 +00:00
Guido van Rossum 68de37973f Add the option to pass an open file object to GzipFile. This obviates
the need for the StringIO subclass.
1997-07-19 20:22:23 +00:00
Guido van Rossum 1526219431 Adding Jeremy Hylton's gzip module.
This requires Andrew Kuchling's zlib extension module.
It still needs some doc strings.
1997-04-30 16:04:57 +00:00