diff options
author | Lars Gustäbel <lars@gustaebel.de> | 2010-06-03 09:56:22 +0000 |
---|---|---|
committer | Lars Gustäbel <lars@gustaebel.de> | 2010-06-03 09:56:22 +0000 |
commit | 2ee9c6fa506595fd296879823f0b445f0aec26ce (patch) | |
tree | 0a9a0fbbf5f071cc0783c9212655b28ad3d5ddc7 /Lib/test | |
parent | 593e4ca7a5300752c1fe595c22caa859b7fcd5fb (diff) | |
download | cpython-git-2ee9c6fa506595fd296879823f0b445f0aec26ce.tar.gz |
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.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_tarfile.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 52d6ab3a88..0d58cdacff 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -662,10 +662,14 @@ class WriteTest(WriteTestBase): if hasattr(os, "link"): link = os.path.join(TEMPDIR, "link") target = os.path.join(TEMPDIR, "link_target") - open(target, "wb").close() + fobj = open(target, "wb") + fobj.write("aaa") + fobj.close() os.link(target, link) try: tar = tarfile.open(tmpname, self.mode) + # Record the link target in the inodes list. + tar.gettarinfo(target) tarinfo = tar.gettarinfo(link) self.assertEqual(tarinfo.size, 0) finally: |