This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mdk
Recipients Jeffrey.Kintscher, adunand, andrew.garner, catlee, lars.gustaebel, mdk, serhiy.storchaka
Date 2020-07-09.09:29:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Strange fact, this was already fixed in 011525ee92eb1c13ad1a62d28725a840e28f8160 (which closes issue10761, nice spot Andrew) but was lost during a merge in 0d28a61d23:

$ git show 0d28a61d23
commit 0d28a61d233c02c458c8b4a25613be2f4979331e
Merge: ed3a303548 d7c9d9cdcd

$ git show 0d28a61d23:Lib/ | grep unlink  # The merge commit does no longer contains the fix

$ git show ed3a303548:Lib/ | grep unlink  # The "left" parent does not contains it neither

$ git show d7c9d9cdcd:Lib/ | grep unlink  # The "right" one does contains it.

Stranger fact, the test was not lost during the merge, and still lives today (test_extractall_symlinks).

Happen that the current test is passing because it's in part erroneous, instead of trying to create a symlink on an existing one, it creates a symlink far far away:

(Pdb) p targetpath

Aditionally it passes anway because tar.errorlevel equals 1, which means the error is logged but not raised.

With the following small patch:

--- a/Lib/test/
+++ b/Lib/test/
@@ -1339,10 +1339,10 @@ class WriteTest(WriteTestBase, unittest.TestCase):
             os.symlink(source_file, target_file)
             with, 'w') as tar:
-                tar.add(source_file)
-                tar.add(target_file)
+                tar.add(source_file, arcname="source")
+                tar.add(target_file, arcname="symlink")
             # Let's extract it to the location which contains the symlink
-            with as tar:
+            with, errorlevel=2) as tar:
                 # this should not raise OSError: [Errno 17] File exists

the error is raised as expected: FileExistsError: [Errno 17] File exists: '/home/mdk/clones/python/cpython/@test_649794_tmpæ-tardir/testsymlinks/source' -> '/home/mdk/clones/python/cpython/@test_649794_tmpæ-tardir/testsymlinks/symlink'

I'm opening an PR to restore this as it was intended.
Date User Action Args
2020-07-09 09:29:15mdksetrecipients: + mdk, lars.gustaebel, catlee, adunand, serhiy.storchaka, andrew.garner, Jeffrey.Kintscher
2020-07-09 09:29:15mdksetmessageid: <>
2020-07-09 09:29:15mdklinkissue12800 messages
2020-07-09 09:29:15mdkcreate