Commit Graph

23 Commits

Author SHA1 Message Date
Antoine Pitrou b74fc2b5fe Issue #3860: GzipFile and BZ2File now support the context manager protocol. 2009-01-10 16:13:45 +00:00
Antoine Pitrou f0d2c3f730 Issue #4272: Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream. 2009-01-04 21:29:23 +00:00
Georg Brandl e08e3d0686 #2959: allow multiple close() calls for GzipFile. 2008-05-25 08:07:37 +00:00
Neal Norwitz 36a59b4a08 Remove the test file before writing it in case there is no write permission.
This might help fix some of the failures on Windows box(es).  It doesn't hurt
either way and ensure the tests are a little more self contained (ie have
less assumptions).
2008-04-10 05:46:39 +00:00
Christian Heimes c5f05e45cf Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
Lars Gustäbel 5b1a785702 Patch #1647484: Renamed GzipFile's filename attribute to name. The
filename attribute is still accessible as a property that emits a
DeprecationWarning.
2007-02-13 16:09:24 +00:00
Tim Peters f733abb783 Whitespace normalization. 2007-01-30 03:03:46 +00:00
Martin v. Löwis 065f0c8a06 Patch #1355023: support whence argument for GzipFile.seek. 2006-11-12 10:41:39 +00:00
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
Andrew M. Kuchling a6f68e1b1f Convert gzip test suite to use unittest 2005-06-09 14:12:36 +00:00
Neal Norwitz 014f103705 SF bug #999776, zlib home page wrong
Backport candidate.
2004-07-29 03:55:56 +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
Guido van Rossum 3b0a3293c3 Massive changes from SF 589982 (tempfile.py rewrite, by Zack
Weinberg).  This changes all uses of deprecated tempfile functions to
the recommended ones.
2002-08-09 16:38:32 +00:00
Barry Warsaw 408b6d34de Complete the absolute import patch for the test suite. All relative
imports of test modules now import from the test package.  Other
related oddities are also fixed (like DeprecationWarning filters that
weren't specifying the full import part, etc.).  Also did a general
code cleanup to remove all "from test.test_support import *"'s.  Other
from...import *'s weren't changed.
2002-07-30 23:27:12 +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 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
Guido van Rossum f27cc5bc74 Marc-Andre must not have run these tests -- they used verify() but
didn't import it.  Also got rid of some inconsistent spaces inside
parentheses in test_gzip.py.
2001-01-17 21:43:06 +00:00
Marc-André Lemburg 3661908a6a This patch removes all uses of "assert" in the regression test suite
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-17 19:11:13 +00:00
Fred Drake 004d5e6880 Make reindent.py happy (convert everything to 4-space indents!). 2000-10-23 17:22:08 +00:00
Andrew M. Kuchling 85ab7384f6 Exercise .readline() and .readlines(). More data is written to the
test file, too, so the methods have more work to do.
2000-07-29 20:18:34 +00:00
Guido van Rossum 052364b20b Use binary mode for all gzip files we open. 1999-04-07 19:00:58 +00:00
Andrew M. Kuchling 605ebddbea Added a simple test suite for gzip. It simply opens a temp file,
writes a chunk of compressed data, closes it, writes another chunk, and
reads the contents back to verify that they are the same.
1999-03-25 21:50:27 +00:00