summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge with 3.2.Georg Brandl2011-08-131-0/+8
|\ \ | |/
| * Fix #11513: wrong exception handling for the case that GzipFile itself ↵Georg Brandl2011-08-131-0/+8
| | | | | | | | raises an IOError.
* | Issue #12451: Add support.create_empty_file()Victor Stinner2011-06-301-3/+3
| | | | | | | | | | | | | | We don't need to create a temporary buffered binary or text file object just to create an empty file. Replace also os.fdopen(handle).close() by os.close(handle).
* | Replace open(filename, 'rU') by open(filename, 'r')Victor Stinner2011-05-041-1/+1
| | | | | | | | The U flag is no more used (but still accepted for backward compatibility).
* | Wrap the correct test with the skip decorator for the issue10761.Senthil Kumaran2011-04-291-1/+2
|\ \ | |/ | | | | merge from 3.2.
| * merge from 3.1Senthil Kumaran2011-04-291-1/+2
| |\
| | * Wrap the testskip decorator for the proper test to resolve bb failure.Senthil Kumaran2011-04-291-1/+1
| | |
* | | merge from 3.2Senthil Kumaran2011-04-281-0/+1
|\ \ \ | |/ /
| * | merge from 3.1Senthil Kumaran2011-04-281-0/+1
| |\ \ | | |/
| | * skip the extractall test on platforms where os.symlink is not available.Senthil Kumaran2011-04-281-0/+1
| | |
* | | merge from 3.2Senthil Kumaran2011-04-281-0/+28
|\ \ \ | |/ /
| * | merge from 3.1Senthil Kumaran2011-04-281-0/+28
| |\ \ | | |/
| | * Add tests for tarfile extractall feature when with symlinksSenthil Kumaran2011-04-281-0/+27
| | |
| | * Merged revisions 81665 via svnmerge fromLars Gustäbel2010-06-031-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81665 | lars.gustaebel | 2010-06-03 12:11:52 +0200 (Thu, 03 Jun 2010) | 11 lines Merged revisions 81663 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81663 | lars.gustaebel | 2010-06-03 11:56:22 +0200 (Thu, 03 Jun 2010) | 4 lines Issue #8833: tarfile created hard link entries with a size field != 0 by mistake. The associated testcase did not expose this bug because it was broken too. ........ ................
| | * Merged revisions 80618 via svnmerge fromLars Gustäbel2010-04-291-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80618 | lars.gustaebel | 2010-04-29 17:37:02 +0200 (Thu, 29 Apr 2010) | 10 lines Merged revisions 80616 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80616 | lars.gustaebel | 2010-04-29 17:23:38 +0200 (Thu, 29 Apr 2010) | 4 lines Issue #8464: tarfile.open(name, mode="w|") no longer creates files with execute permissions set. ........ ................
| | * Merged revisions 76453 via svnmerge fromLars Gustäbel2009-11-231-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r76453 | lars.gustaebel | 2009-11-23 16:48:33 +0100 (Mon, 23 Nov 2009) | 10 lines Merged revisions 76452 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76452 | lars.gustaebel | 2009-11-23 16:46:19 +0100 (Mon, 23 Nov 2009) | 3 lines Add a testcase that checks if the TarFile constructor successfully closes the internal file object in case of an error (issue #7341). ........ ................
| | * Merged revisions 76219 via svnmerge fromAntoine Pitrou2009-11-111-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r76219 | antoine.pitrou | 2009-11-11 21:59:38 +0100 (mer., 11 nov. 2009) | 9 lines Merged revisions 76217 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76217 | antoine.pitrou | 2009-11-11 21:55:07 +0100 (mer., 11 nov. 2009) | 3 lines Issue #7295: Do not use a hardcoded file name in test_tarfile. ........ ................
| | * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
| * | Merged revisions 88528 via svnmerge fromLars Gustäbel2011-02-231-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88528 | lars.gustaebel | 2011-02-23 12:42:22 +0100 (Wed, 23 Feb 2011) | 16 lines Issue #11224: Improved sparse file read support (r85916) introduced a regression in _FileInFile which is used in file-like objects returned by TarFile.extractfile(). The inefficient design of the _FileInFile.read() method causes various dramatic side-effects and errors: - The data segment of a file member is read completely into memory every(!) time a small block is accessed. This is not only slow but may cause unexpected MemoryErrors with very large files. - Reading members from compressed tar archives is even slower because of the excessive backwards seeking which is done when the same data segment is read over and over again. - As a backwards seek on a TarFile opened in stream mode is not possible, using extractfile() fails with a StreamError. ........
* | | Normalize the encoding names for Latin-1 and UTF-8 toMarc-André Lemburg2011-02-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'latin-1' and 'utf-8'. These are optimized in the Python Unicode implementation to result in more direct processing, bypassing the codec registry. Also see issue11303.
* | | Issue #11224: Improved sparse file read support (r85916) introduced aLars Gustäbel2011-02-231-0/+16
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regression in _FileInFile which is used in file-like objects returned by TarFile.extractfile(). The inefficient design of the _FileInFile.read() method causes various dramatic side-effects and errors: - The data segment of a file member is read completely into memory every(!) time a small block is accessed. This is not only slow but may cause unexpected MemoryErrors with very large files. - Reading members from compressed tar archives is even slower because of the excessive backwards seeking which is done when the same data segment is read over and over again. - As a backwards seek on a TarFile opened in stream mode is not possible, using extractfile() fails with a StreamError.
* | Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into aRaymond Hettinger2011-01-261-0/+4
| | | | | | | | | | | | | | keyword-only argument. The preceding positional argument was deprecated, so it made no sense to add filter as a positional argument. (Patch reviewed by Brian Curtin and Anthony Long.)
* | Fix #9333. The symlink function is always available now, raising OSErrorBrian Curtin2010-12-281-4/+2
| | | | | | | | when the user doesn't hold the symbolic link privilege rather than hiding it.
* | Fix #9333. Expose os.symlink on Windows only when usable.Brian Curtin2010-12-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to create symlinks on Windows, SeCreateSymbolicLinkPrivilege is an account privilege that is required to be held by the user. Not only must the privilege be enabled for the account, the activated privileges for the currently running application must be adjusted to enable the requested privilege. Rather than exposing an additional function to be called prior to the user's first os.symlink call, we handle the AdjustTokenPrivileges Windows API call internally and only expose os.symlink when the privilege escalation was successful. Due to the change of only exposing os.symlink when it's available, we can go back to the original test skipping methods of checking via `hasattr`.
* | #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-1/+1
| |
* | Remove extracted trees at the end of the test.Martin v. Löwis2010-11-011-8/+17
| |
* | Issue #10184: Touch directories only once when extracting a tarfile.Martin v. Löwis2010-11-011-0/+9
| |
* | Issue #10233: Close file objects in a timely manner in the tarfile moduleAntoine Pitrou2010-10-291-27/+48
| | | | | | | | and its test suite.
* | test_tarfile: woops, remove +0.001 which was used to debugVictor Stinner2010-10-291-1/+1
| |
* | test_tarfile: dump mtime as hexadecimal on test_extractall failureVictor Stinner2010-10-291-1/+11
| |
* | Add read support for all missing variants of the GNU sparseLars Gustäbel2010-10-291-7/+63
| | | | | | | | | | | | | | | | extensions. Thus, in addition to GNUTYPE_SPARSE headers, sparse information in pax headers created by GNU tar can now be decoded. All three formats 0.0, 0.1 and 1.0 are supported. On filesystems that support this, holes in files are now restored whenever a sparse member is extracted.
* | Revert r85801. The test ought to pass without rounding.Martin v. Löwis2010-10-231-1/+1
| |
* | Try to fix test_tarfile on AMD64 debian parallel 3.xVictor Stinner2010-10-231-1/+1
| | | | | | | | | | tarinfo.mtime is an int, whereas getmtime() is a float and it might be different by something like 3 µs.
* | Further tarfile / test_tarfile cleanupAntoine Pitrou2010-09-231-1/+2
| |
* | Try harder to fix test_tarfile under Windows buildbotsAntoine Pitrou2010-09-231-1/+3
| |
* | Try to fix test_tarfile issues on Windows buildbots by closing fileAntoine Pitrou2010-09-231-298/+387
| | | | | | | | objects explicitly instead of letting them linger on.
* | Re-flow several long lines from #1578269.Brian Curtin2010-07-091-3/+6
| |
* | Implement #1578269. Patch by Jason R. Coombs.Brian Curtin2010-07-081-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added Windows support for os.symlink when run on Windows 6.0 or greater, aka Vista. Previous Windows versions will raise NotImplementedError when trying to symlink. Includes numerous test updates and additions to test_os, including a symlink_support module because of the fact that privilege escalation is required in order to run the tests to ensure that the user is able to create symlinks. By default, accounts do not have the required privilege, so the escalation code will have to be exposed later (or documented on how to do so). I'll be following up with that work next. Note that the tests use ctypes, which was agreed on during the PyCon language summit.
* | Merged revisions 81667 via svnmerge fromLars Gustäbel2010-06-031-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81667 | lars.gustaebel | 2010-06-03 14:34:14 +0200 (Thu, 03 Jun 2010) | 8 lines Issue #8741: Fixed the TarFile.makelink() method that is responsible 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. ........
* | Merged revisions 81663 via svnmerge fromLars Gustäbel2010-06-031-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81663 | lars.gustaebel | 2010-06-03 11:56:22 +0200 (Thu, 03 Jun 2010) | 4 lines Issue #8833: tarfile created hard link entries with a size field != 0 by mistake. The associated testcase did not expose this bug because it was broken too. ........
* | Issue #8633: Support for POSIX.1-2008 binary pax headers.Lars Gustäbel2010-05-171-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | tarfile is now able to read and write pax headers with a "hdrcharset=BINARY" record. This record was introduced in POSIX.1-2008 as a method to store unencoded binary strings that cannot be translated to UTF-8. In practice, this is just a workaround that allows a tar implementation to store filenames that do not comply with the current filesystem encoding and thus cannot be decoded correctly. Additionally, tarfile works around a bug in current versions of GNU tar: undecodable filenames are stored as-is in a pax header without a "hdrcharset" record being added. Technically, these headers are invalid, but tarfile manages to read them correctly anyway.
* | Issue #8390: tarfile uses surrogateespace as the default error handlerVictor Stinner2010-05-051-2/+2
| | | | | | | | (instead of replace in read mode or strict in write mode)
* | Merged revisions 80616 via svnmerge fromLars Gustäbel2010-04-291-0/+18
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80616 | lars.gustaebel | 2010-04-29 17:23:38 +0200 (Thu, 29 Apr 2010) | 4 lines Issue #8464: tarfile.open(name, mode="w|") no longer creates files with execute permissions set. ........
* | Merged revisions ↵Benjamin Peterson2010-03-211-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 78966,78970,79018,79026-79027,79055,79156,79159,79163-79164,79173,79176,79194,79208,79212 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78966 | florent.xicluna | 2010-03-14 10:20:59 -0500 (Sun, 14 Mar 2010) | 2 lines Do not hardcode Expat version. It's possible to build Python with --with-system-expat option. ........ r78970 | benjamin.peterson | 2010-03-14 21:58:24 -0500 (Sun, 14 Mar 2010) | 1 line this little exception dance is pointless ........ r79018 | collin.winter | 2010-03-16 22:04:01 -0500 (Tue, 16 Mar 2010) | 1 line Delete unused import. ........ r79026 | vinay.sajip | 2010-03-17 10:05:57 -0500 (Wed, 17 Mar 2010) | 1 line Issue #8162: logging: Clarified docstring and documentation for disable function. ........ r79027 | collin.winter | 2010-03-17 12:36:16 -0500 (Wed, 17 Mar 2010) | 1 line Avoid hardcoding refcounts in tests. ........ r79055 | benjamin.peterson | 2010-03-18 16:30:48 -0500 (Thu, 18 Mar 2010) | 1 line remove installation of deleted test/output dir ........ r79156 | florent.xicluna | 2010-03-20 17:21:02 -0500 (Sat, 20 Mar 2010) | 2 lines Cleanup test_struct using check_warnings. ........ r79159 | florent.xicluna | 2010-03-20 17:26:42 -0500 (Sat, 20 Mar 2010) | 2 lines Cleanup test_tarfile, and use check_warnings. ........ r79163 | michael.foord | 2010-03-20 19:53:39 -0500 (Sat, 20 Mar 2010) | 1 line A faulty load_tests in a test module no longer halts test discovery. A placeholder test, that reports the failure, is created instead. ........ r79164 | michael.foord | 2010-03-20 19:55:58 -0500 (Sat, 20 Mar 2010) | 1 line Change order of arguments in a unittest function. ........ r79173 | georg.brandl | 2010-03-21 04:09:38 -0500 (Sun, 21 Mar 2010) | 1 line Document that GzipFile supports iteration. ........ r79176 | georg.brandl | 2010-03-21 04:17:41 -0500 (Sun, 21 Mar 2010) | 1 line Introduce copy by slicing, used in later chapters. ........ r79194 | florent.xicluna | 2010-03-21 06:58:11 -0500 (Sun, 21 Mar 2010) | 2 lines Use assertRaises and add a specific warning filter. ........ r79208 | andrew.kuchling | 2010-03-21 13:47:12 -0500 (Sun, 21 Mar 2010) | 1 line Add items ........ r79212 | georg.brandl | 2010-03-21 14:01:38 -0500 (Sun, 21 Mar 2010) | 1 line Fix plural. ........
* | Merged revisions 78093 via svnmerge fromGeorg Brandl2010-03-141-1/+0
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78093 | georg.brandl | 2010-02-07 18:03:15 +0100 (So, 07 Feb 2010) | 1 line Remove unused imports in test modules. ........
* | Merged revisions 78623 via svnmerge fromLars Gustäbel2010-03-031-0/+60
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78623 | lars.gustaebel | 2010-03-03 12:55:48 +0100 (Wed, 03 Mar 2010) | 3 lines Issue #7232: Add support for the context manager protocol to the TarFile class. ........
* | use assert[Not]In where appropriateBenjamin Peterson2010-01-191-1/+1
| | | | | | | | A patch from Dave Malcolm.
* | Merged revisions 76452 via svnmerge fromLars Gustäbel2009-11-231-0/+18
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r76452 | lars.gustaebel | 2009-11-23 16:46:19 +0100 (Mon, 23 Nov 2009) | 3 lines Add a testcase that checks if the TarFile constructor successfully closes the internal file object in case of an error (issue #7341). ........
* | Merged revisions 76443 via svnmerge fromLars Gustäbel2009-11-221-5/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r76443 | lars.gustaebel | 2009-11-22 19:30:53 +0100 (Sun, 22 Nov 2009) | 24 lines Issue #6123: Fix opening empty archives and files. (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. ........
* | Merged revisions 76217 via svnmerge fromAntoine Pitrou2009-11-111-7/+3
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r76217 | antoine.pitrou | 2009-11-11 21:55:07 +0100 (mer., 11 nov. 2009) | 3 lines Issue #7295: Do not use a hardcoded file name in test_tarfile. ........