summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
Commit message (Collapse)AuthorAgeFilesLines
* 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. :-)
* Quick fix for tests that fail on systems with an encoding otherLars Gustäbel2007-03-131-6/+7
| | | | than 'iso8859-1'.
* This is the implementation of POSIX.1-2001 (pax) format read/writeLars Gustäbel2007-03-131-581/+761
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support. The TarInfo class now contains all necessary logic to process and create tar header data which has been moved there from the TarFile class. The fromtarfile() method was added. The new path and linkpath properties are aliases for the name and linkname attributes in correspondence to the pax naming scheme. The TarFile constructor and classmethods now accept a number of keyword arguments which could only be set as attributes before (e.g. dereference, ignore_zeros). The encoding and pax_headers arguments were added for pax support. There is a new tarinfo keyword argument that allows using subclassed TarInfo objects in TarFile. The boolean TarFile.posix attribute is deprecated, because now three tar formats are supported. Instead, the desired format for writing is specified using the constants USTAR_FORMAT, GNU_FORMAT and PAX_FORMAT as the format keyword argument. This change affects TarInfo.tobuf() as well. The test suite has been heavily reorganized and partially rewritten. A new testtar.tar was added that contains sample data in many formats from 4 different tar programs. Some bugs and quirks that also have been fixed: Directory names do no longer have a trailing slash in TarInfo.name or TarFile.getnames(). Adding the same file twice does not create a hardlink file member. The TarFile constructor does no longer need a name argument. The TarFile._mode attribute was renamed to mode and contains either 'r', 'w' or 'a'.
* A missing binary mode in AppendTest caused failures in WindowsLars Gustäbel2007-02-141-2/+2
| | | | Buildbot.
* Patch #1652681: create nonexistent files in append mode andLars Gustäbel2007-02-061-0/+56
| | | | allow appending to empty files.
* Patch #1504073: Fix tarfile.open() for mode "r" with a fileobj argument.Lars Gustäbel2006-12-271-0/+11
| | | | Will backport to 2.5.
* Patch #1262036: Prevent TarFiles from being added to themselves underLars Gustäbel2006-12-231-0/+14
| | | | | | certain conditions. Will backport to 2.5.
* Patch #1230446: tarfile.py: fix ExFileObject so that read() and tell()Lars Gustäbel2006-12-231-1/+11
| | | | | | work correctly together with readline(). Will backport to 2.5.
* Testcase for patch #1484695.Georg Brandl2006-12-201-0/+23
|
* Patch #1610437: fix a tarfile bug with long filename headers.Georg Brandl2006-12-061-9/+13
|
* Patch [ 1583506 ] tarfile.py: 100-char filenames are truncatedGeorg Brandl2006-10-241-0/+27
|
* Fix bug #1543303, tarfile adds padding that breaks gunzip.Neal Norwitz2006-08-211-0/+21
| | | | | | Patch # 1543897. Will backport to 2.5
* The cheery optimism of old age.Tim Peters2006-05-271-13/+1
|
* More random thrashing trying to understand spuriousTim Peters2006-05-271-1/+13
| | | | Windows failures. Who's keeping a bz2 file open?
* Explicitly close files. I'm trying to stop the frequent spurious test_tarfileTim Peters2006-05-261-9/+32
| | | | | | failures on Windows buildbots, but it's hard to know how since the regrtest failure output is useless here, and it never fails when a buildbot slave runs test_tarfile the second time in verbose mode.
* Use open() to open files (was using file()).Tim Peters2006-05-261-10/+10
|
* test_directory(): Remove the leftover temp directory that's makingTim Peters2006-05-151-0/+4
| | | | the Windows buildbots fail test_tarfile.
* ReadDetectFileobjTest: repair Windows disasters by openingTim Peters2006-05-151-1/+2
| | | | | | | | | | the file object in binary mode. The Windows buildbot slaves shouldn't swap themselves to death anymore. However, test_tarfile may still fail because of a temp directory left behind from a previous failing run. Windows buildbot owners may need to remove that directory by hand.
* [ 1488881 ] tarfile.py: support for file-objects and bz2 (cp. #1488634)Georg Brandl2006-05-151-0/+23
|
* Patch #1484695: Update the tarfile module to version 0.8. This fixesGeorg Brandl2006-05-101-2/+47
| | | | | a couple of issues, notably handling of long file names using the GNU LONGNAME extension.
* Patch #1338314, Bug #1336623: fix tarfile so it can extractNeal Norwitz2005-10-281-0/+30
| | | | | | REGTYPE directories from tarfiles written by old programs. Will backport.
* Fix SF bug # 1330039, patch # 1331635 from Lars Gustaebel (tarfile maintainer)Neal Norwitz2005-10-201-1/+48
| | | | | | | | | | | | | | Problem: if two files are assigned the same inode number by the filesystem, the second one will be added as a hardlink to the first, which means that the content will be lost. The patched code checks if the file's st_nlink is greater 1. So only for files that actually have several links pointing to them hardlinks will be created, which is what GNU tar does. Will backport.
* Patch #1168594: set sizes of non-regular files to zero. Fixes #1167128.Martin v. Löwis2005-08-271-0/+35
| | | | Will backport to 2.4.
* Patch #918101: Add tarfile open mode r|* for auto-detection of theMartin v. Löwis2005-03-051-2/+27
| | | | stream compression; add, for symmetry reasons, r:* as a synonym of r.
* Patch #1107973: tarfile.ExFileObject iterators.Martin v. Löwis2005-03-031-0/+10
|
* Whitespace normalization.Tim Peters2004-10-251-1/+1
|
* Add test case for bug #1017553Andrew M. Kuchling2004-10-201-0/+9
|
* Flush bz2 data even if nothing had been written so far. Fixes #1013882.Martin v. Löwis2004-08-221-1/+7
| | | | Will backport to 2.3.
* SF #857297 and 916874, improve handling of hard links when extractingNeal Norwitz2004-07-201-0/+21
|
* SF #846659, fix bufsize violation and GNU longname/longlink extensionsNeal Norwitz2004-07-201-1/+90
|
* When calling tarname with an argument (and thus not use testtar.tar) return aBrett Cannon2003-06-121-1/+1
| | | | path for the file in the temp directory for the platform.
* Make creation of temporary file and directory more portable. Also made cleanupBrett Cannon2003-06-121-7/+8
| | | | | | | | | | code use proper functions to get paths. Changed the name of tar file that is searched for to be absolute (i.e., not use os.extsep) since filename is locked in based on name of file in CVS (testtar.tar). Closes bug #731403 .
* Patch #734231: Update RiscOS support. In particular, correctMartin v. Löwis2003-05-101-4/+4
| | | | riscospath.extsep, and use os.extsep throughout.
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-19/+18
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* Get test working if gzip support is not availableNeal Norwitz2003-04-141-1/+2
|
* The filename fix of the previous checkin was complete bogus, the problem is ↵Jack Jansen2003-03-071-3/+3
| | | | elsewhere. Retracting.
* Two fixes to make this test pass on MacOS9:Jack Jansen2003-03-071-4/+4
| | | | | | | - the test was sloppy about filenames: "0-REGTYPE-TEXT" was used where the archive held "/0-REGTYPE-TEXT". - tarfile extracts all files in binary mode, but the test expected to be able to read and compare text files in text mode. Use universal text mode.
* Removed debugging print in test_tarfile.Tim Peters2003-02-191-1/+0
| | | | | In the Windows installer, continued the endless battle to copy over files with new one-shot extensions.
* Whitespace normalization.Tim Peters2003-02-191-0/+1
|