diff options
Diffstat (limited to 'Lib/test/test_tarfile.py')
-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 c0741ee..ec6f82f 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -661,10 +661,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(b"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: |