summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #28449: tarfile.open() with mode "r" or "r:" now tries to open a tarSerhiy Storchaka2016-10-301-1/+8
| | | | | file with compression before trying to open it without compression. Otherwise it had 50% chance failed with ignore_zeros=True.
* #7944: close files explicitly in test_tarfile (backport d560eece0857).Ezio Melotti2016-01-131-278/+365
|
* Convert test_tarfile to ASCII (backport c1ed490bd266).Ezio Melotti2016-01-131-21/+19
|
* Backport support.change_cwd() and use it in tests.Serhiy Storchaka2015-09-061-5/+2
|
* Issue #24259: tarfile now raises a ReadError if an archive is truncated ↵Lars Gustäbel2015-07-061-0/+24
| | | | inside a data segment.
* Issue #24514: tarfile now tolerates number fields consisting of only whitespace.Lars Gustäbel2015-07-021-0/+9
|
* Backout 308f3c1e36d3. This change (issue21044) does not need to be merged onSerhiy Storchaka2014-07-221-33/+5
| | | | 2.7, as the os.fdopen sets the name attribute to '<fdopen>' and not to the fd.
* Issue 21044: tarfile.open() now handles fileobj with an integer 'name'Serhiy Storchaka2014-07-161-5/+33
| | | | attribute. Based on patch by Martin Panter.
* Issue #19920: Added tests for TarFile.list(). Based on patch by Vajrasky Kok.Serhiy Storchaka2014-02-051-0/+77
|
* Issue #20243: TarFile no longer raise ReadError when opened in write mode.Serhiy Storchaka2014-01-181-0/+16
|
* Backported test for issue #20238.Serhiy Storchaka2014-01-181-0/+6
|
* Issue #20245: The open functions in the tarfile module now correctly handle ↵Serhiy Storchaka2014-01-181-0/+14
| | | | empty mode.
* Backported test for the open of non-existent tarfile.Serhiy Storchaka2014-01-131-0/+8
|
* Issue #19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-101-11/+6
|
* Issue #16601: Restarting iteration over tarfile no more continues from whereSerhiy Storchaka2013-05-091-0/+8
| | | | it left off. Patch by Michael Birtwell.
* Issue #16645: Fix hardlink extracting test for tarfile.Serhiy Storchaka2012-12-301-16/+11
|
* Issue #16793. Replace deprecated unittest asserts with modern counterparts.Serhiy Storchaka2012-12-271-1/+1
|
* Issue #14160: TarFile.extractfile() failed to resolve symbolic links whenLars Gustäbel2012-04-241-0/+3
| | | | the links were not located in an archive subdirectory.
* Issue #13639: Accept unicode filenames in tarfile.open(mode="w|gz").Lars Gustäbel2011-12-211-0/+7
| | | | | | Passing a unicode filename to tarfile.open() along with mode "w|gz" failed with a UnicodeError because the filename was not encoded properly before being written to the gzipped stream in the FNAME extra field.
* Correctly detect bzip2 compressed streams with blocksizes other than 900k.Lars Gustäbel2011-12-061-0/+17
|
* Fix closes issue #12088 - fixes the tarfile.extractall issue when theSenthil Kumaran2011-05-171-0/+60
| | | | | symlinks/hardlink was broken. It handles now in a graceful manner (No exception is raised, behavior similar GNU tar).
* skip the extractall test on platforms where os.symlink is not available.Senthil Kumaran2011-04-281-0/+1
|
* Fix closes issue10761: tarfile.extractall failure when symlinked files are ↵Senthil Kumaran2011-04-281-0/+27
| | | | present.
* Issue #8741: Fixed the TarFile.makelink() method that is responsibleLars Gustäbel2010-06-031-0/+45
| | | | | | | | for extracting symbolic and hard link entries as regular files as a work-around on platforms that do not support filesystem links. This stopped working reliably after a change in r74571. I also added a few tests for this functionality.
* Issue #8833: tarfile created hard link entries with a sizeLars Gustäbel2010-06-031-1/+5
| | | | | field != 0 by mistake. The associated testcase did not expose this bug because it was broken too.
* Issue #8464: tarfile.open(name, mode="w|") no longer createsLars Gustäbel2010-04-291-0/+18
| | | | files with execute permissions set.
* Cleanup test_tarfile, and use check_warnings.Florent Xicluna2010-03-201-9/+12
|
* Issue #7232: Add support for the context manager protocolLars Gustäbel2010-03-031-0/+60
| | | | to the TarFile class.
* Remove unused imports in test modules.Georg Brandl2010-02-071-1/+0
|
* use assert[Not]In where appropriateEzio Melotti2010-01-231-1/+1
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-3/+1
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-1/+3
| | | | Patch by flox
* Add a testcase that checks if the TarFile constructor successfullyLars Gustäbel2009-11-231-0/+18
| | | | closes the internal file object in case of an error (issue #7341).
* Issue #6123: Fix opening empty archives and files.Lars Gustäbel2009-11-221-5/+80
| | | | | | | | | | | | | | | | | | | | | | | (Note that an empty archive is not the same as an empty file. An empty archive contains no members and is correctly terminated with an EOF block full of zeros. An empty file contains no data at all.) The problem was that although tarfile was able to create empty archives, it failed to open them raising a ReadError. On the other hand, tarfile opened empty files without error in most read modes and presented them as empty archives. (However, some modes still raised errors: "r|gz" raised ReadError, but "r:gz" worked, "r:bz2" even raised EOFError.) In order to get a more fine-grained control over the various internal error conditions I now split up the HeaderError exception into a number of meaningful sub-exceptions. This makes it easier in the TarFile.next() method to react to the different conditions in the correct way. The visible change in its behaviour now is that tarfile will open empty archives correctly and raise ReadError consistently for empty files.
* Issue #7295: Do not use a hardcoded file name in test_tarfile.Antoine Pitrou2009-11-111-7/+3
|
* Issue #6856: Add a filter keyword argument to TarFile.add().Lars Gustäbel2009-09-121-0/+28
| | | | | | | | | The filter argument must be a function that takes a TarInfo object argument, changes it and returns it again. If the function returns None the TarInfo object will be excluded from the archive. The exclude argument is deprecated from now on, because it does something similar but is not as flexible.
* Issue #6054: Do not normalize stored pathnames.Lars Gustäbel2009-08-281-0/+70
| | | | | | No longer use tarfile.normpath() on pathnames. Store pathnames unchanged, i.e. do not remove "./", "../" and "//" occurrences. However, still convert absolute to relative paths.
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-54/+54
|
* Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loopLars Gustäbel2009-03-221-0/+25
| | | | | | forever on incomplete input. That caused tarfile.open() to hang when used with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or partial bzip2 compressed data.
* Issue #4616: TarFile.utime(): Restore directory times on Windows.Lars Gustäbel2008-12-121-6/+3
|
* Issue #3838: TarFile object assigned to self.tar should be closed explicitly.Hirokazu Yamamoto2008-09-211-0/+1
| | | | Reviewed by Lars Gustäbel.
* Do not close external file objects passed to tarfile.open(mode='w:bz2')Lars Gustäbel2008-05-271-2/+14
| | | | when the TarFile is closed.
* Make sure that xstar headers are read correctly.Lars Gustäbel2008-02-111-0/+9
|
* Issue #1735: TarFile.extractall() now correctly setsLars Gustäbel2008-01-041-0/+17
| | | | | | directory permissions and times. (will backport to 2.5)
* Issue #1531: Read fileobj from the current offset, do not seek toLars Gustäbel2007-12-011-0/+32
| | | | | | the start. (will backport to 2.5)
* TarFile.__init__() no longer fails if no name argument is passed andLars Gustäbel2007-08-281-1/+15
| | | | | | the fileobj argument has no usable name attribute (e.g. StringIO). (will backport to 2.5)
* Added exclude keyword argument to the TarFile.add() method.Lars Gustäbel2007-06-181-0/+21
|
* Have md5 raise a DeprecationWarning as per PEP 4.Brett Cannon2007-05-301-2/+2
|
* Added errors argument to TarFile class that allows the user toLars Gustäbel2007-05-271-65/+181
| | | | | | | | | | | | | | | | | | | | specify an error handling scheme for character conversion. Additional scheme "utf-8" in read mode. Unicode input filenames are now supported by design. The values of the pax_headers dictionary are now limited to unicode objects. Fixed: The prefix field is no longer used in PAX_FORMAT (in conformance with POSIX). Fixed: In read mode use a possible pax header size field. Fixed: Strip trailing slashes from pax header name values. Fixed: Give values in user-specified pax_headers precedence when writing. Added unicode tests. Added pax/regtype4 member to testtar.tar all possible number fields in a pax header. Added two chapters to the documentation about the different formats tarfile.py supports and how unicode issues are handled.
* Whitespace normalization. Ugh, we really need to do this more often.Neal Norwitz2007-04-251-1/+0
| | | | You might want to review this change as it's my first time. Be gentle. :-)