summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #6856: Add a filter keyword argument to TarFile.add().Lars Gustäbel2009-09-121-6/+21
| | | | | | | | | 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-29/+12
| | | | | | No longer use tarfile.normpath() on pathnames. Store pathnames unchanged, i.e. do not remove "./", "../" and "//" occurrences. However, still convert absolute to relative paths.
* #4351: more appropriate DeprecationWarning stacklevelsPhilip Jenvey2009-05-081-1/+2
|
* Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loopLars Gustäbel2009-03-221-5/+4
| | | | | | 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 #5341: Fix a variety of spelling errors.Mark Dickinson2009-02-211-1/+1
|
* Issue #4616: TarFile.utime(): Restore directory times on Windows.Lars Gustäbel2008-12-121-4/+0
|
* Remove a dict.has_key() and list.sort(cmp=) usage from tarfile to silenceBrett Cannon2008-08-041-2/+3
| | | | warnings under -3.
* Issue #3039: Fix TarFileCompat.writestr() which always raised anLars Gustäbel2008-08-021-4/+7
| | | | | | AttributeError since __slots__ were added to zipfile.ZipInfo in r46967 two years ago. Add a warning about the removal of TarFileCompat in Python 3.0.
* Do not close external file objects passed to tarfile.open(mode='w:bz2')Lars Gustäbel2008-05-271-1/+0
| | | | when the TarFile is closed.
* A stab in the dark attempt to fix the alpha/tru64 buildbot problem and add moreGregory P. Smith2008-03-251-2/+2
| | | | test coverage of valid inputs to zlib.crc32.
* Issue #2004: Use mode 0700 for temporary directories and defaultLars Gustäbel2008-02-051-9/+9
| | | | | | permissions for missing directories. (will backport to 2.5)
* Issue #1735: TarFile.extractall() now correctly setsLars Gustäbel2008-01-041-4/+4
| | | | | | 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-1/+2
| | | | | | the start. (will backport to 2.5)
* TarFile.__init__() no longer fails if no name argument is passed andLars Gustäbel2007-08-281-1/+1
| | | | | | 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-4/+10
|
* Added errors argument to TarFile class that allows the user toLars Gustäbel2007-05-271-101/+134
| | | | | | | | | | | | | | | | | | | | 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.
* Remove direct call's to file's constructor and replace them with calls toBrett Cannon2007-05-251-4/+5
| | | | open() as ths is considered best practice.
* This is the implementation of POSIX.1-2001 (pax) format read/writeLars Gustäbel2007-03-131-334/+646
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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'.
* Patch #1652681: create nonexistent files in append mode andLars Gustäbel2007-02-061-2/+7
| | | | allow appending to empty files.
* Patch #1507247: tarfile.py: use current umask for intermediateLars Gustäbel2007-01-231-13/+1
| | | | directories.
* Patch #1504073: Fix tarfile.open() for mode "r" with a fileobj argument.Lars Gustäbel2006-12-271-0/+4
| | | | Will backport to 2.5.
* Patch #1262036: Prevent TarFiles from being added to themselves underLars Gustäbel2006-12-231-27/+6
| | | | | | certain conditions. Will backport to 2.5.
* Patch #1230446: tarfile.py: fix ExFileObject so that read() and tell()Lars Gustäbel2006-12-231-106/+153
| | | | | | work correctly together with readline(). Will backport to 2.5.
* Testcase for patch #1484695.Georg Brandl2006-12-201-6/+5
|
* Patch #1484695: The tarfile module now raises a HeaderError exceptionGeorg Brandl2006-12-191-10/+17
| | | | if a buffer given to frombuf() is invalid.
* Patch #1610437: fix a tarfile bug with long filename headers.Georg Brandl2006-12-061-2/+6
|
* Patch #1583880: fix tarfile's problems with long names and posix/Georg Brandl2006-10-291-88/+81
| | | | GNU modes.
* Patch [ 1583506 ] tarfile.py: 100-char filenames are truncatedGeorg Brandl2006-10-241-1/+1
|
* Fix tarfile depending on buggy int('1\0', base) behavior.Georg Brandl2006-10-121-1/+1
|
* Fix bug #1543303, tarfile adds padding that breaks gunzip.Neal Norwitz2006-08-211-3/+0
| | | | | | Patch # 1543897. Will backport to 2.5
* _Stream.close(): Try to kill struct.pack() warnings whenTim Peters2006-08-021-1/+7
| | | | | | | | | | writing the crc to file on the "PPC64 Debian trunk" buildbot when running test_tarfile. This is again a case where the native zlib crc is an unsigned 32-bit int, but the Python wrapper implicitly casts it to signed C long, so that "the sign bit looks different" on different platforms.
* Part of SF patch #1484695. This removes dead code. The chksum wasNeal Norwitz2006-07-101-7/+0
| | | | | | already verified in .frombuf() on the lines above. If there was a problem an exception is raised, so there was no way this condition could have been true.
* Always close BZ2Proxy object. Remove unnecessary struct usage.Georg Brandl2006-05-271-13/+10
|
* Whitespace normalization.Tim Peters2006-05-191-1/+1
|
* Amendments to patch #1484695.Georg Brandl2006-05-181-45/+52
|
* [ 1488881 ] tarfile.py: support for file-objects and bz2 (cp. #1488634)Georg Brandl2006-05-151-2/+67
|
* Patch #1484695: Update the tarfile module to version 0.8. This fixesGeorg Brandl2006-05-101-180/+200
| | | | | 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-5/+6
| | | | | | 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/+2
| | | | | | | | | | | | | | 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.
* Minor cleanup.Raymond Hettinger2005-09-111-2/+1
|
* Patch #1168594: set sizes of non-regular files to zero. Fixes #1167128.Martin v. Löwis2005-08-271-14/+12
| | | | Will backport to 2.4.
* Revert previous checkin.Martin v. Löwis2005-08-241-7/+20
|
* Patch #1262036: Make tarfile name absolute. Fixes #1257255.Martin v. Löwis2005-08-241-20/+7
| | | | Will backport to 2.4.
* Fix all wrong instances of "it's".Georg Brandl2005-07-221-1/+1
|
* Whitespace normalization.Tim Peters2005-03-281-1/+1
|
* Patch #918101: Add tarfile open mode r|* for auto-detection of theMartin v. Löwis2005-03-051-30/+66
| | | | stream compression; add, for symmetry reasons, r:* as a synonym of r.
* Patch #1043890: tarfile: add extractall() method.Martin v. Löwis2005-03-041-0/+41
|
* Patch #1103407: Properly deal with tarfile iterators when untarringMartin v. Löwis2005-03-031-4/+15
| | | | symbolic links on Windows. Fixes #1100429. Will backport to 2.4.
* Patch #1107973: tarfile.ExFileObject iterators.Martin v. Löwis2005-03-031-0/+16
|
* Use decorators.Guido van Rossum2005-01-161-10/+5
|