Commit Graph

45 Commits

Author SHA1 Message Date
Andrew M. Kuchling
01cb47b59c [Bug #1074261, patch #1074381] Restrict the size of chunks read from the file in order to avoid overflow or huge memory consumption. Patch by Mark Eichin 2005-06-09 14:19:32 +00:00
Tim Peters
eba28bea9b Whitespace normalization. 2005-03-28 01:08:02 +00:00
Martin v. Löwis
f2a8d63e4f Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
Partially fixes #1110242.
2005-03-03 08:35:22 +00:00
Tim Peters
49667c257b Ack, removed useless import of os I just introduced. 2004-07-27 21:05:21 +00:00
Tim Peters
5cfb05eef0 Added a new fileno() method. ZODB's repozo.py wants this so it can
apply os.fsync() to the GzipFile backup files it creates.
2004-07-27 21:02:02 +00:00
Walter Dörwald
70a6b49821 Replace backticks with repr() or "%r"
From SF patch #852334.
2004-02-12 17:35:32 +00:00
Brett Cannon
edfb30258e Fix error in exception message. 2003-12-04 19:28:06 +00:00
Andrew M. Kuchling
64edd6ac1d [Patch #654421 from Matthew Mueller]
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.
2003-02-05 21:35:07 +00:00
Tim Peters
9288f95cb5 Another round on SF patch 618135: gzip.py and files > 2G
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.
2002-11-05 20:38:55 +00:00
Tim Peters
fb0ea525d5 Related to SF patch 618135: gzip.py and files > 2G.
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.
2002-11-04 19:50:11 +00:00
Guido van Rossum
97c5fccd77 Remove mention of deprecated xreadlines method. 2002-08-06 17:03:25 +00:00
Raymond Hettinger
aef22fb9cd Patch 560023 adding docstrings. 2.2 Candidate (after verifying modules were not updated after 2.2). 2002-05-29 16:18:42 +00:00
Skip Montanaro
12424bc0ef force gzip module to open files using 'b'inary mode.
closes patch #536278.
2002-05-23 01:43:05 +00:00
Tim Peters
863ac44b74 Whitespace normalization. 2002-04-16 01:38:40 +00:00
Guido van Rossum
8ca162f417 Partial introduction of bools where appropriate. 2002-04-07 06:36:23 +00:00
Neil Schemenauer
cacbdf6229 Make GzipFile an iterator. Closes bug #532621. 2002-03-20 18:36:00 +00:00
Martin v. Löwis
db04489953 Patch #443899: Check modes on files before performing operations.
Use IOErrors where file objects use them.
2002-03-11 06:46:52 +00:00
Fred Drake
95b0eb7cb3 "f" should be "self"; reported by Neal Norwitz. 2001-10-13 18:33:51 +00:00
Andrew M. Kuchling
f31d31373e Remove redefinition of writelines() method
Remove unused variable and import
2001-08-13 14:54:12 +00:00
Tim Peters
ab9ba27dc0 Whitespace normalization. 2001-08-09 21:40:30 +00:00
Martin v. Löwis
8cc965c1fb Patch #448474: Add support for tell() and seek() to gzip.GzipFile. 2001-08-09 07:21:56 +00:00
Andrew M. Kuchling
44f5f8fb26 Bug #409419: delete seek() and tell() methods, so callers can use getattr()
to check for them (instead of calling them and then ignoring an
    IOError)
2001-03-20 15:51:14 +00:00
Jack Jansen
2d0589be67 The code to write timestamps couldn't handle negative times (and time
on the Mac is negativevalues > 0x80000000). Fixed.
2001-02-21 10:39:35 +00:00
Eric S. Raymond
ee5e61d3bc String method conversion. 2001-02-09 09:10:35 +00:00
Skip Montanaro
2dd4276559 added a few more __all__ lists
fixed typo in ihooks docstring
2001-01-23 15:35:05 +00:00