summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipfile.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-98098: Create packages from zipfile and test_zipfile (gh-98103)Jason R. Coombs2022-11-261-3430/+0
| | | | | | | | | | | | | * gh-98098: Move zipfile into a package. * Moved test_zipfile to a package * Extracted module for test_path. * Add blurb * Add jaraco as owner of zipfile.Path. * Synchronize with minor changes found at jaraco/zipp@d9e7f4352d.
* gh-45108: Improve docstring and testing of ZipFile.testfile() (GH-96233)Serhiy Storchaka2022-09-031-4/+5
|
* gh-88339: enable fast seeking of uncompressed unencrypted zipfile.ZipExtFile ↡JuniorJPDJ2022-08-061-0/+2
| | | | | | | (GH-27737) Avoid reading all of the intermediate data in uncompressed items in a zip file when the user seeks forward. Contributed by: @JuniorJPDJ
* gh-94018: Remove trailing spaces in _sanitize_windows_name (GH-94040)Robin Plumey2022-06-281-0/+2
| | | | | | | | Closes #94018. Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
* gh-83245: Raise BadZipFile instead of ValueError when reading a corrupt ZIP ↡Sam Ezeh2022-05-231-0/+11
| | | | | | file (GH-32291) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-91917: Fix test_zipfile on non-UTF-8 locale (GH-91921)Serhiy Storchaka2022-04-261-0/+11
| | | Skip the extraction test if file names are not encodable.
* bpo-4833: Add ZipFile.mkdir (GH-32160)Sam Ezeh2022-04-051-0/+53
|
* bpo-28080: Add support for the fallback encoding in ZIP files (GH-32007)Serhiy Storchaka2022-03-221-2/+138
| | | | | | * Add the metadata_encoding parameter in the zipfile.ZipFile constructor. * Add the --metadata-encoding option in the zipfile CLI. Co-authored-by: Stephen J. Turnbull <stephen@xemacs.org>
* bpo-44439: _ZipWriteFile.write() handle buffer protocol correctly (GH-29468)Ma Lin2022-03-081-0/+9
| | | | Co-authored-by: Marco Ribeiro <marcoffee@users.noreply.github.com>
* bpo-40280: Address more test failures on Emscripten (GH-31050)Christian Heimes2022-02-051-3/+5
| | | Co-authored-by: Brett Cannon <brett@python.org>
* bpo-40280: Skip subprocess-based tests on wasm32-emscripten (GH-30615)Christian Heimes2022-01-251-1/+3
|
* bpo-39359: [zipfile] add missing "pwd: expected bytes, got str" exception ↡Daniel Hillier2021-09-231-4/+17
| | | | (GH-18031)
* bpo-44129: Add descriptive global variables for general purpose bit flags ↡Daniel Hillier2021-07-031-1/+1
| | | | | | | | | | | (GH-26118) Replace hex flag masks with named global variables to improve readability. eg. if flags & 0x800 becomes: if flags & _MASK_UTF_FILENAME
* bpo-44095: Add suffix, stem and suffixes to zipfile.Path (GH-26129)Miguel Brito2021-05-141-0/+58
|
* bpo-43651: Fix EncodingWarning in zipfile (GH-25650)Inada Naoki2021-04-271-28/+28
|
* bpo-42090: zipfile.Path.joinpath now accepts multiple arguments (GH-22976)Jason R. Coombs2020-12-161-0/+6
| | | Automerge-Triggered-By: GH:jaraco
* 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.