summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipfile.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-42043: Add support for zipfile.Path subclasses (#22716)Jason R. Coombs2020-10-251-106/+206
| | | | | * bpo-42043: Add support for zipfile.Path inheritance as introduced in zipp 3.2.0. * Add blurb.
* bpo-40564: Avoid copying state from extant ZipFile. (GH-22371)Jason R. Coombs2020-10-031-0/+33
| | | bpo-40564: Avoid copying state from extant ZipFile.
* bpo-40105: ZipFile truncate in append mode with shorter comment (GH-19337)Jan Mazur2020-09-281-0/+3
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21317)Hai Shi2020-07-061-3/+4
|
* bpo-41068: Fix read after write in zipfile for non-ASCII files names. (GH-21040)Serhiy Storchaka2020-06-221-0/+5
|
* bpo-40275: More lazy imports in test.support (GH-20131)Hai Shi2020-05-181-20/+20
| | | | | | | | | | | | | | | | | | | Make the the following imports lazy in test.support: * bz2 * gzip * lzma * resource * zlib The following test.support decorators now need to be called with parenthesis: * @support.requires_bz2 * @support.requires_gzip * @support.requires_lzma * @support.requires_zlib For example, "@requires_zlib" becomes "@requires_zlib()".
* bpo-40286: Use random.randbytes() in tests (GH-19575)Victor Stinner2020-04-171-7/+4
|
* bpo-39667: Sync zipp 3.0 (GH-18540)Jason R. Coombs2020-02-291-1/+7
| | | | | | | | | | | | | | * bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct performance degradation as found in zipp 3.0 * πŸ“œπŸ€– Added by blurb_it. * Update docs for new zipfile.Path.open * Rely on dict, faster than OrderedDict. * Syntax edits on docs Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39595: Improve zipfile.Path performance (#18406)Jason R. Coombs2020-02-121-39/+103
| | | | | | | | | | | | | | | | | | * Improve zipfile.Path performance on zipfiles with a large number of entries. * πŸ“œπŸ€– Added by blurb_it. * Add bpo to blurb * Sync with importlib_metadata 1.5 (6fe70ca) * Update blurb. * Remove compatibility code * Add stubs module, omitted from earlier commit Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39502: Skip test_zipfile.test_add_file_after_2107() on AIX (GH-18282)Victor Stinner2020-01-301-1/+6
| | | | Skip test_zipfile.test_add_file_after_2107() if time.localtime() fails with OverflowError. It is the case on AIX 6.1 for example.
* bpo-39460: Fix test_zipfile.test_add_file_after_2107() (GH-18247)Victor Stinner2020-01-291-0/+12
| | | | | | | | XFS filesystem is limited to 32-bit timestamp, but the utimensat() syscall doesn't fail. Moreover, there is a VFS bug which returns a cached timestamp which is different than the value on disk. https://bugzilla.redhat.com/show_bug.cgi?id=1795576 https://bugs.python.org/issue39460#msg360952
* bpo-37523: Raise ValueError for I/O operations on a closed ↡Daniel Hillier2019-11-301-0/+14
| | | | | zipfile.ZipExtFile. (GH-14658) Raises ValueError when calling the following on a closed zipfile.ZipExtFile: read, readable, seek, seekable, tell.
* bpo-36993: Improve error reporting for zipfiles with bad zip64 extra data. ↡Daniel Hillier2019-10-291-0/+222
| | | | (GH-14656)
* bpo-38334: Fix seeking backward on an encrypted zipfile.ZipExtFile. (GH-16937)Serhiy Storchaka2019-10-271-0/+38
| | | Test by Daniel Hillier.
* bpo-36991: Fix incorrect exception escaping ZipFile.extract() (GH-13632)Berker Peksag2019-09-121-0/+11
|
* bpo-28494: Test existing zipfile working behavior. (GH-15853)Gregory P. Smith2019-09-101-0/+40
| | | | Add unittests for executables with a zipfile appended to test_zipfile, as zipfile.is_zipfile and zipfile.ZipFile work properly on these today.
* bpo-26185: Fix repr() on empty ZipInfo object (#13441)MickaΓ«l Schoentgen2019-09-091-0/+27
| | | | | | | | | | | | * bpo-26185: Fix repr() on empty ZipInfo object It was failing on AttributeError due to inexistant but required attributes file_size and compress_size. They are now initialized to 0 in ZipInfo.__init__(). * Remove useless hasattr() in ZipInfo._open_to_write() * Completely remove file_size setting in _open_to_write().
* bpo-37772: fix zipfile.Path.iterdir() outputs (GH-15170)shireenrao2019-08-241-46/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix Path._add_implied_dirs to include all implied directories * fix Path._add_implied_dirs to include all implied directories * Optimize code by using sets instead of lists * πŸ“œπŸ€– Added by blurb_it. * fix Path._add_implied_dirs to include all implied directories * Optimize code by using sets instead of lists * πŸ“œπŸ€– Added by blurb_it. * Add tests to zipfile.Path.iterdir() fix * Update test for zipfile.Path.iterdir() * remove whitespace from test file * Rewrite NEWS blurb to describe the user-facing impact and avoid implementation details. * remove redundant [] within set comprehension * Update to use unique_everseen to maintain order and other suggestions in review * remove whitespace and add back add_dirs in tests * Add new standalone function parents using posixpath to get parents of a directory * removing whitespace (sorry) * Remove import pathlib from zipfile.py * Rewrite _parents as a slice on a generator of the ancestry of a path. * Remove check for '.' and '/', now that parents no longer returns those. * Separate calculation of implied dirs from adding those * Re-use _implied_dirs in tests for generating zipfile with dir entries. * Replace three fixtures (abcde, abcdef, abde) with one representative example alpharep. * Simplify implementation of _implied_dirs by collapsing the generation of parent directories for each name.
* bpo-37520: Correct behavior for zipfile.Path.parent (GH-14638)Jason R. Coombs2019-07-071-0/+11
| | | | | | * bpo-37520: Correct behavior for zipfile.Path.parent * πŸ“œπŸ€– Added by blurb_it.
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-2/+0
|
* Add support for .parent and .joinpath in zipfile.Path (#13213)Jason R. Coombs2019-05-091-0/+14
|
* bpo-36832: add zipfile.Path (#13153)Jason R. Coombs2019-05-081-3/+113
| | | | | | | | | | | | | | | | | | | | | | | | * bpo-36832: add zipfile.Path * bpo-36832: add documentation for zipfile.Path * πŸ“œπŸ€– Added by blurb_it. * Remove module reference from blurb. * Sort the imports * Update docstrings and docs per recommendations. * Rely on test.support.temp_dir * Signal that 'root' is the parameter. * Correct spelling of 'mod' * Convert docstring to comment for brevity. * Fix more errors in the docs
* bpo-36434: Properly handle writing errors in ZIP files. (GH-12559)Serhiy Storchaka2019-03-301-0/+37
| | | | | Errors during writing no longer prevent to properly close the ZIP file.
* bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683)Serhiy Storchaka2018-09-171-0/+14
|
* bpo-34097: Polish API design (GH-8725)Marcel Plch2018-08-311-4/+4
| | | Move strict_timestamps to constructor.
* bpo-34325: Skip zipfile test for large timestamps when filesystem don't ↡Marcel Plch2018-08-031-1/+5
| | | | | | support them. (GH-8656) When the filesystem doesn't support files with large timestamps, skip testing that such files can be zipped.
* bpo-34097: Add support for zipping files older than 1980-01-01 (GH-8270)Marcel Plch2018-08-021-0/+16
| | | | | ZipFile can zip files older than 1980-01-01 and newer than 2107-12-31 using a new strict_timestamps parameter at the cost of setting the timestamp to the limit.
* bpo-34035: Fix several AttributeError in zipfile seek() methods. (GH-8527)MickaΓ«l Schoentgen2018-07-291-0/+4
|
* bpo-22908: Add seek and tell functionality to ZipExtFile (GH-4966)John Jolly2018-01-301-0/+34
| | | | | This allows for nested zip files, tar files within zip files, zip files within tar files, etc. Contributed by: John Jolly
* bpo-21417: Add compresslevel= to the zipfile module (GH-5385)Bo Bayles2018-01-301-4/+36
| | | | | | This allows the compression level to be specified when writing zipfiles (for the entire file *and* overridden on a per-file basis). Contributed by Bo Bayles
* Fix miscellaneous typos (#4275)luzpaz2017-11-051-1/+1
|
* bpo-30017: Allowed calling the close() method of the zip entry writer object ↡Serhiy Storchaka2017-04-121-0/+42
| | | | | | (#1041) multiple times. Writing to closed zip entry writer object now always produce a ValueError.
* bpo-29958: Minor improvements to zipfile and tarfile CLI. (#944)Serhiy Storchaka2017-04-071-0/+10
|
* bpo-29919: Remove unused imports found by pyflakes (#137)Victor Stinner2017-03-271-1/+1
| | | Make also minor PEP8 coding style fixes on modified imports.
* bpo-28231: The zipfile module now accepts path-like objects for external ↡Serhiy Storchaka2017-03-081-15/+102
| | | | paths. (#511)
* Issue #28115: ZIP creation test requires zlib.Serhiy Storchaka2016-10-231-0/+1
|\
| * Issue #28115: ZIP creation test requires zlib.Serhiy Storchaka2016-10-231-0/+1
| |\
| | * Issue #28115: ZIP creation test requires zlib.Serhiy Storchaka2016-10-231-0/+1
| | |
* | | Issue #28115: Command-line interface of the zipfile module now uses argparse.Serhiy Storchaka2016-10-231-27/+31
|/ / | | | | | | Added support of long options.
* | Issue #28115: Added tests for CLI of the zipfile module.Serhiy Storchaka2016-10-231-1/+67
|\ \ | |/
| * Issue #28115: Added tests for CLI of the zipfile module.Serhiy Storchaka2016-10-231-1/+67
| |
* | Issue #26293: Fixed writing ZIP files that starts not from the start of theSerhiy Storchaka2016-10-071-0/+43
|\ \ | |/ | | | | | | file. Offsets in ZIP file now are relative to the start of the archive in conforming to the specification.
| * Issue #26293: Fixed writing ZIP files that starts not from the start of theSerhiy Storchaka2016-10-071-0/+43
| | | | | | | | | | file. Offsets in ZIP file now are relative to the start of the archive in conforming to the specification.
* | Issue #24693: Changed some RuntimeError's in the zipfile module to moreSerhiy Storchaka2016-09-101-20/+20
| | | | | | | | appropriate types. Improved some error messages and debugging output.
* | Issue #27029: Removed deprecated support of universal newlines mode from ↡Serhiy Storchaka2016-06-111-163/+4
| | | | | | | | ZipFile.open().
* | Restored test_interleaved. After issue #8886 it was a duplicate ofSerhiy Storchaka2016-05-131-4/+5
|\ \ | |/ | | | | test_different_file.
| * Restored test_interleaved. After issue #8886 it was a duplicate ofSerhiy Storchaka2016-05-131-4/+5
| | | | | | | | test_different_file.
* | Issue #26039: zipfile.ZipFile.open() can now be used to write data into a ZIPSerhiy Storchaka2016-05-131-6/+77
| | | | | | | | file, as well as for extracting data. Patch by Thomas Kluyver.
* | Issue #23277: Remove unused sys and os importsBerker Peksag2016-04-241-1/+0
| | | | | | | | Patch by Jon Dufresne.
* | Issue #26039: Added zipfile.ZipInfo.from_file() and zipinfo.ZipInfo.is_dir().Serhiy Storchaka2016-02-071-0/+15
|/ | | | Patch by Thomas Kluyver.