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 Scott.Leerssen
Recipients Scott.Leerssen, lars.gustaebel, orsenthil, pitrou, python-dev, santoso.wijaya, srid
Date 2011-05-13.16:57:08
SpamBayes Score 1.5929249e-05
Marked as misclassified No
Message-id <1305305828.72.0.0214989644134.issue10761@psf.upfronthosting.co.za>
In-reply-to
Content
here is a diff of a better fix based on the previous patch:


Index: tarfile.py
===================================================================
--- tarfile.py  (revision 49758)
+++ tarfile.py  (working copy)
@@ -2239,12 +2239,14 @@
         if hasattr(os, "symlink") and hasattr(os, "link"):
             # For systems that support symbolic and hard links.
             if tarinfo.issym():
-                if os.path.exists(targetpath):
+                if os.path.lexists(targetpath):
                     os.unlink(targetpath)
                 os.symlink(tarinfo.linkname, targetpath)
             else:
                 # See extract().
                 if os.path.exists(tarinfo._link_target):
+                    if os.path.lexists(targetpath):
+                        os.unlink(targetpath)
                     os.link(tarinfo._link_target, targetpath)
                 else:
                     self._extract_member(self._find_link_target(tarinfo), targetpath)
History
Date User Action Args
2011-05-13 16:57:08Scott.Leerssensetrecipients: + Scott.Leerssen, lars.gustaebel, orsenthil, pitrou, srid, santoso.wijaya, python-dev
2011-05-13 16:57:08Scott.Leerssensetmessageid: <1305305828.72.0.0214989644134.issue10761@psf.upfronthosting.co.za>
2011-05-13 16:57:08Scott.Leerssenlinkissue10761 messages
2011-05-13 16:57:08Scott.Leerssencreate