summaryrefslogtreecommitdiff
path: root/Lib/test/test_gzip.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.10] bpo-45229: Remove test_main in many tests (GH-28405) (GH-28455)Serhiy Storchaka2021-09-191-6/+1
| | | | | | | | | | | Instead of explicitly enumerate test classes for run_unittest() use the unittest ability to discover tests. This also makes these tests discoverable and runnable with unittest. load_tests() can be used for dynamic generating tests and adding doctests. setUpModule(), tearDownModule() and addModuleCleanup() can be used for running code before and after all module tests. (cherry picked from commit 40348acc180580371d25f75f46b27048e35f2435)
* bpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol ↵Miss Islington (bot)2021-06-221-0/+9
| | | | | | | | | | correctly (GH-26764) (GH-26845) No longer use len() to get the length of the input data. For some buffer protocol objects, the length obtained by using len() is wrong. (cherry picked from commit bc6c12c72a9536acc96e7b9355fd69d1083a43c1) Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
* bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25171)Inada Naoki2021-04-041-6/+6
| | | | | | | | | | | * Fix test_float * Fix _osx_support * Fix test_fstring * Fix test_gc * Fix test_gzip * Fix test_hashlib * Fix unrelated whitespace issue Co-authored-by: Ned Deily <nad@python.org>
* bpo-43316: gzip: Fix sys.exit() usage. (GH-24652)Inada Naoki2021-02-261-1/+1
|
* bpo-43316: gzip: CLI uses non-zero return code on error. (GH-24647)Ruben Vorderman2021-02-251-4/+4
| | | | Exit code is now 1 instead of 0. A message is printed to stderr instead of stdout. This is the proper behaviour for a tool that can be used in scripts.
* bpo-40275: Use new test.support helper submodules in tests (GH-21451)Hai Shi2020-08-031-11/+13
|
* bpo-41069: Make TESTFN and the CWD for tests containing non-ascii ↵Serhiy Storchaka2020-06-251-4/+14
| | | | characters. (GH-21035)
* bpo-39389: gzip: fix compression level metadata (GH-18077)William Chargin2020-01-211-0/+20
| | | | | | As described in RFC 1952, section 2.3.1, the XFL (eXtra FLags) byte of a gzip member header should indicate whether the DEFLATE algorithm was tuned for speed or compression ratio. Prior to this patch, archives emitted by the `gzip` module always indicated maximum compression.
* bpo-28286: Deprecate opening GzipFile for writing implicitly. (GH-16417)Serhiy Storchaka2019-11-161-1/+3
| | | | Always specify the mode argument for writing.
* bpo-6584: Add a BadGzipFile exception to the gzip module. (GH-13022)Zackery Spytz2019-05-131-0/+9
| | | | | Co-Authored-By: Filip Gruszczyński <gruszczy@gmail.com> Co-Authored-By: Michele Orrù <maker@tumbolandia.net>
* bpo-16079: fix duplicate test method name in test_gzip. (GH-12827)Gregory P. Smith2019-04-141-1/+1
|
* bpo-34898: Add mtime parameter to gzip.compress(). (GH-9704)guoci2018-11-071-0/+11
| | | | | Without setting mtime, time.time() will be used as the timestamp which will end up in the compressed data and each invocation of the compress() function will vary over time.
* bpo-34969: Add --fast, --best on the gzip CLI (GH-9833)Stéphane Wirtel2018-11-031-2/+30
|
* bpo-23596: Add unit tests for the command line for the gzip module (GH-9775)Stéphane Wirtel2018-10-091-6/+93
| | | | Add unit tests for the command line for the gzip module
* bpo-28286: Add tests for the mode argument of GzipFile. (#4074)Serhiy Storchaka2017-10-221-0/+24
|
* Issue #28227: gzip now supports pathlibBerker Peksag2016-10-021-0/+22
| | | | Patch by Ethan Furman.
* Use sequence repetition instead of bytes constructor with integer argument.Serhiy Storchaka2016-09-111-2/+2
|
* Issue #25626: Change zlib to accept Py_ssize_t and cap to UINT_MAXMartin Panter2015-11-201-0/+9
| | | | | | | | | | | | | | The underlying zlib library stores sizes in “unsigned int”. The corresponding Python parameters are all sizes of buffers filled in by zlib, so it is okay to reduce higher values to the UINT_MAX internal cap. OverflowError is still raised for sizes that do not fit in Py_ssize_t. Sizes are now limited to Py_ssize_t rather than unsigned long, because Python byte strings cannot be larger than Py_ssize_t. Previously this could result in a SystemError on 32-bit platforms. This resolves a regression in the gzip module when reading more than UINT_MAX or LONG_MAX bytes in one call, introduced by revision 62723172412c.
* Issue #23529: Limit the size of decompressed data when reading fromAntoine Pitrou2015-04-111-2/+21
| | | | | | | | GzipFile, BZ2File or LZMAFile. This defeats denial of service attacks using compressed bombs (i.e. compressed payloads which decompress to a huge size). Patch by Martin Panter and Nikolaus Rath.
* Issue #23688: Added support of arbitrary bytes-like objects and avoidedSerhiy Storchaka2015-03-231-0/+37
| | | | | unnecessary copying of memoryview in gzip.GzipFile.write(). Original patch by Wolfgang Maier.
* Issue #20875: Merge from 3.3Ned Deily2014-03-091-0/+7
|\
| * Issue #20875: Prevent possible gzip "'read' is not defined" NameError.Ned Deily2014-03-091-0/+7
| | | | | | | | Patch by Claudiu Popa.
| * Issue #19936: Remove executable bits from C source files and several forgottenSerhiy Storchaka2014-01-161-0/+0
| | | | | | | | test files.
* | Issue #19936: Added executable bits or shebang lines to Python scripts whichSerhiy Storchaka2014-01-161-1/+0
|\ \ | |/ | | | | | | | | | | requires them. Disable executable bits and shebang lines in test and benchmark files in order to prevent using a random system python, and in source files of modules which don't provide command line interface. Fixed shebang lines in the unittestgui and checkpip scripts.
| * Issue #19936: Added executable bits or shebang lines to Python scripts whichSerhiy Storchaka2014-01-161-1/+0
| | | | | | | | | | | | | | requires them. Disable executable bits and shebang lines in test and benchmark files in order to prevent using a random system python, and in source files of modules which don't provide command line interface. Fixed shebang line to use python3 executable in the unittestgui script.
| * Back out patch for #1159051, which caused backwards compatibility problems.Georg Brandl2013-05-121-14/+0
| |
* | Issue #19222: Add support for the 'x' mode to the gzip module.Nadeem Vawda2013-10-191-0/+37
|/ | | | Original patch by Tim Heaney.
* Close #17666: Fix reading gzip files with an extra field.Serhiy Storchaka2013-04-081-0/+7
|
* Issue #1159051: GzipFile now raises EOFError when reading a corrupted fileSerhiy Storchaka2013-01-221-0/+14
|\ | | | | | | | | with truncated header or footer. Added tests for reading truncated gzip, bzip2, and lzma files.
| * Issue #1159051: GzipFile now raises EOFError when reading a corrupted fileSerhiy Storchaka2013-01-221-0/+15
| | | | | | | | | | with truncated header or footer. Added tests for reading truncated gzip and bzip2 files.
* | Fix GzipFile's handling of filenames given as bytes objects.Nadeem Vawda2012-06-201-0/+14
|\ \ | |/ | | | | Add relevant tests for GzipFile, and also for BZ2File and LZMAFile.
| * Fix GzipFile's handling of filenames given as bytes objects.Nadeem Vawda2012-06-201-0/+14
| |
* | Add fileobj support to gzip.open().Nadeem Vawda2012-06-041-0/+13
| |
* | Really fix test_gzip failures on Windows.Nadeem Vawda2012-05-061-5/+7
| |
* | Fix test_gzip failures on Windows.Nadeem Vawda2012-05-061-3/+3
| |
* | Separate tests for gzip.GzipFile and gzip.open.Nadeem Vawda2012-05-061-15/+14
| |
* | Closes #13989: Add support for text modes to gzip.open().Nadeem Vawda2012-05-061-0/+88
| | | | | | | | Also, add tests for gzip.open().
* | Merge: #13781: Fix GzipFile to work with os.fdopen()'d file objects.Nadeem Vawda2012-01-181-0/+8
|\ \ | |/
| * Issue #13781: Fix GzipFile to work with os.fdopen()'d file objects.Nadeem Vawda2012-01-181-0/+8
| |
* | #13012: use splitlines(keepends=True/False) instead of splitlines(0/1).Ezio Melotti2011-09-281-2/+2
| |
* | Issue #10791: Implement missing method GzipFile.read1(), allowing GzipFileAntoine Pitrou2011-04-041-0/+23
|/ | | | to be wrapped in a TextIOWrapper. Patch by Nadeem Vawda.
* #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-2/+2
|
* #10465: fix broken delegation in __getattr__ of _PaddedFile.Georg Brandl2010-11-201-0/+6
|
* Implement #7944. Use `with` throughout the test suite.Brian Curtin2010-10-131-117/+104
|
* Issue #9759: GzipFile now raises ValueError when an operation is attemptedAntoine Pitrou2010-10-061-0/+22
| | | | after the file is closed. Patch by Jeffrey Finkelstein.
* Issue #9962: GzipFile now has the peek() method.Antoine Pitrou2010-09-291-0/+22
|
* Issue #1675951: Allow GzipFile to work with unseekable file objects.Antoine Pitrou2010-09-231-0/+21
| | | | Patch by Florian Festi.
* Issue #3488: Provide convenient shorthand functions `gzip.compress`Antoine Pitrou2010-08-171-0/+20
| | | | and `gzip.decompress`. Original patch by Anand B. Pillai.
* convert shebang lines: python -> python3Benjamin Peterson2010-03-111-1/+1
|
* Merged revisions 77472-77473 via svnmerge fromAntoine Pitrou2010-01-131-0/+12
| | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77472 | antoine.pitrou | 2010-01-13 15:32:10 +0100 (mer., 13 janv. 2010) | 5 lines Issue #2846: Add support for gzip.GzipFile reading zero-padded files. Patch by Brian Curtin. ........ r77473 | antoine.pitrou | 2010-01-13 15:32:51 +0100 (mer., 13 janv. 2010) | 3 lines Add ACKS entry for r77472. ........