Commit Graph

161 Commits

Author SHA1 Message Date
Serhiy Storchaka a89d22aff3 Issue #28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
file with compression before trying to open it without compression.  Otherwise
it had 50% chance failed with ignore_zeros=True.
2016-10-30 20:52:29 +02:00
Lars Gustäbel ddd9917ac3 Issue #24838: Fix test_tarfile.py for non-utf8 filesystem encodings. 2016-04-19 11:58:41 +02:00
Lars Gustäbel 0f450abec4 Issue #24838: tarfile's ustar and gnu formats now correctly calculate name and
link field limits for multibyte character encodings like utf-8.
2016-04-19 08:43:17 +02:00
Serhiy Storchaka 5fbadb63ef Use support.change_cwd() in tests. 2015-09-06 14:14:49 +03:00
Serhiy Storchaka 2a23adf440 Use support.change_cwd() in tests. 2015-09-06 14:13:25 +03:00
Lars Gustäbel e12aa62d68 Merge with 3.4: Issue #24259: tarfile now raises a ReadError if an archive is truncated inside a data segment. 2015-07-06 09:29:41 +02:00
Lars Gustäbel 0357268d96 Issue #24259: tarfile now raises a ReadError if an archive is truncated inside a data segment. 2015-07-06 09:27:24 +02:00
Lars Gustäbel 49c521fd5d Merge with 3.4: Issue #24514: tarfile now tolerates number fields consisting of only whitespace. 2015-07-02 19:41:03 +02:00
Lars Gustäbel b7a688b3a4 Issue #24514: tarfile now tolerates number fields consisting of only whitespace. 2015-07-02 19:38:38 +02:00
Lars Gustäbel 20703c6969 tarfile.open() with mode 'x' created files without an end of archive marker. 2015-05-27 12:53:44 +02:00
Zachary Ware ad3e27ae4c Issue #23193: Skip numeric_owner tests on platforms where they don't make sense
In particular, the tests bomb out on Windows.  The feature is a no-op on platforms
without the pwd module or os.geteuid anyway.
2015-05-12 23:57:21 -05:00
Berker Peksag ce643913a9 Issue #9517: Move script_helper to the support package.
Patch by Christie Wilson.
2015-05-06 06:33:17 +03:00
Eric V. Smith 7a80389ce5 Issue 23193: Add numeric_owner to tarfile.TarFile.extract() and tarfile.TarFile.extractall(). 2015-04-15 10:27:58 -04:00
Berker Peksag 0fe6325acf Issue #21717: tarfile.open() now supports 'x' (exclusive creation) mode. 2015-02-13 21:02:12 +02:00
Serhiy Storchaka 4bdcfce512 Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h. 2015-02-10 08:47:10 +02:00
Serhiy Storchaka 832dd5f0d6 Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h. 2015-02-10 08:45:53 +02:00
Victor Stinner 57004c696a Issue #21440: Backport changeset 4ebf97299b18 to branch 3.4, use
support.rmtree() and support.unlink() in test_zipfile & test_tarfile
2014-09-04 00:49:01 +02:00
Serhiy Storchaka a7eb746278 Issue #21549: Added the "members" parameter to TarFile.list(). 2014-08-21 10:01:16 +03:00
Serhiy Storchaka a98faefd68 Issue 21044: tarfile.open() now handles fileobj with an integer 'name'
attribute.  Based on patch by Martin Panter.
2014-07-17 00:00:26 +03:00
Serhiy Storchaka 2c6a3aedeb Issue 21044: tarfile.open() now handles fileobj with an integer 'name'
attribute.  Based on patch by Martin Panter.
2014-07-16 23:58:58 +03:00
Tim Golden e0bd2c5fad Issue21440 Use support.rmtree in test_zipfile & test_tarfile 2014-05-06 13:24:26 +01:00
Serhiy Storchaka f6a38e11c0 Issue #20672: Fixed tests for TarFile.list() on non-UTF-8 locales. 2014-02-19 18:50:35 +02:00
Serhiy Storchaka 162c477f41 Issue #20672: Fixed tests for TarFile.list() on non-UTF-8 locales. 2014-02-19 18:44:12 +02:00
Serhiy Storchaka 255493c813 Issue #19920: TarFile.list() no longer fails when outputs a listing
containing non-encodable characters.  Added tests for TarFile.list().
Based on patch by Vajrasky Kok.
2014-02-05 20:54:43 +02:00
Serhiy Storchaka 3b4f1594ff Issue #19920: TarFile.list() no longer fails when outputs a listing
containing non-encodable characters.  Added tests for TarFile.list().
Based on patch by Vajrasky Kok.
2014-02-05 20:53:36 +02:00
Serhiy Storchaka a7184e617a Fix typo. 2014-01-24 22:28:06 +02:00
Serhiy Storchaka 2d5a0928f1 Issue #20384: Fix the test_tarfile test on Windows.
On Windows os.open() error message doesn't contain file name.
2014-01-24 22:19:23 +02:00
Serhiy Storchaka aee0e63ed0 Issue #20243: TarFile no longer raise ReadError when opened in write mode. 2014-01-18 16:14:49 +02:00
Serhiy Storchaka c2d01423e0 Issue #20243: TarFile no longer raise ReadError when opened in write mode. 2014-01-18 16:14:10 +02:00
Serhiy Storchaka 7d68a1c921 Issue #20238: TarFile opened with external fileobj and "w:gz" mode didn't
write complete output on close.
2014-01-18 15:53:39 +02:00
Serhiy Storchaka 9fbec7ad5e Issue #20238: TarFile opened with external fileobj and "w:gz" mode didn't
write complete output on close.
2014-01-18 15:53:05 +02:00
Serhiy Storchaka ce644a09ac Issue #20245: The open functions in the tarfile module now correctly handle empty mode. 2014-01-18 15:37:21 +02:00
Serhiy Storchaka 53ad0cd284 Issue #20245: The open functions in the tarfile module now correctly handle empty mode. 2014-01-18 15:35:37 +02:00
Serhiy Storchaka f22fe0f507 Test the open of non-exitent tarfile in all modes. 2014-01-13 19:08:00 +02:00
Serhiy Storchaka 2a3d7d1af7 Test the open of non-exitent tarfile in all modes. 2014-01-13 19:07:33 +02:00
Antoine Pitrou 3b7b1e533e Try to fix test_tarfile under Windows 2013-11-24 01:55:05 +01:00
Serhiy Storchaka 5e8c8091ee Build a list of supported test tarfiles dynamically for CLI "test" command
tests (issue13477).
2013-11-24 02:30:59 +02:00
Serhiy Storchaka d27b455bbc Issue #13477: Added command line interface to the tarfile module.
Original patch by Berker Peksag.
2013-11-24 01:53:29 +02:00
Brett Cannon 260fbe80c5 Issue #15767: Excise the remaining instances of ModuleNotFoundError 2013-07-04 18:16:15 -04:00
Serhiy Storchaka 78be6e8aa3 Issue #18223: Refactor test_tarfile.
* Use mixins for generating tests for different compression types.
* Make test_tarfile discoverable.
* Use more special tests (i.e. assertEqual, assertIs) instead of assertTrue.
* Add explicit test skips instead of reporting skipped tests as passed.
* Wrap long lines.
* Correct a comment for test_hardlink_extraction1.
* Add support.requires_gzip.
* Replace ImportError by  ModuleNotFoundError.

and some other minor enhancements.
2013-06-17 16:11:06 +03:00
Serhiy Storchaka 8b56292079 Issue #18223: Refactor test_tarfile.
* Use mixins for generating tests for different compression types.
* Make test_tarfile discoverable.
* Use more special tests (i.e. assertEqual, assertIs) instead of assertTrue.
* Add explicit test skips instead of reporting skipped tests as passed.
* Wrap long lines.
* Correct a comment for test_hardlink_extraction1.
* Add support.requires_gzip.

and some other minor enhancements.
2013-06-17 15:38:50 +03:00
Serhiy Storchaka b3c5d85680 Issue #16601: Restarting iteration over tarfile no more continues from where
it left off.  Patch by Michael Birtwell.
2013-05-09 14:36:58 +03:00
Serhiy Storchaka 263fab94ee Issue #16601: Restarting iteration over tarfile no more continues from where
it left off.  Patch by Michael Birtwell.
2013-05-09 14:22:26 +03:00
Serhiy Storchaka 2aa4e6cdec Issue #16645: Fix hardlink extracting test for tarfile. 2012-12-30 20:18:58 +02:00
Serhiy Storchaka 62c75f1e52 Issue #16645: Fix hardlink extracting test for tarfile. 2012-12-30 20:17:28 +02:00
Serhiy Storchaka 88339c44f8 Issue #16645: Fix hardlink extracting test for tarfile. 2012-12-30 20:16:30 +02:00
Andrew Svetlov f7a17b48d7 Replace IOError with OSError (#16715) 2012-12-25 16:47:37 +02:00
Andrew Svetlov 3438fa496d Get rig of EnvironmentError (#16705) 2012-12-17 23:35:18 +02:00
Lars Gustäbel 7a919e9930 Issue #13815: TarFile.extractfile() now returns io.BufferedReader objects.
The ExFileObject class was removed, some of its code went into _FileInFile.
2012-05-05 18:15:03 +02:00
Lars Gustäbel 9f478c021d Merge with 3.2: Issue #14160: TarFile.extractfile() failed to resolve symbolic
links when the links were not located in an archive subdirectory.
2012-04-24 21:09:17 +02:00