[Python-checkins] python/dist/src/Lib tarfile.py,1.12,1.13

nnorwitz at users.sourceforge.net nnorwitz at users.sourceforge.net
Wed Jul 21 00:07:53 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12094/Lib

Modified Files:
	tarfile.py 
Log Message:
SF #857297 and 916874, improve handling of hard links when extracting

Index: tarfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/tarfile.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** tarfile.py	20 Jul 2004 21:54:17 -0000	1.12
--- tarfile.py	20 Jul 2004 22:07:43 -0000	1.13
***************
*** 1295,1298 ****
--- 1295,1302 ----
              tarinfo = self.getmember(member)
  
+         # Prepare the link target for makelink().
+         if tarinfo.islnk():
+             tarinfo._link_target = os.path.join(path, tarinfo.linkname)
+ 
          try:
              self._extract_member(tarinfo, os.path.join(path, tarinfo.name))
***************
*** 1467,1471 ****
                  os.symlink(linkpath, targetpath)
              else:
!                 os.link(linkpath, targetpath)
          except AttributeError:
              if tarinfo.issym():
--- 1471,1476 ----
                  os.symlink(linkpath, targetpath)
              else:
!                 # See extract().
!                 os.link(tarinfo._link_target, targetpath)
          except AttributeError:
              if tarinfo.issym():



More information about the Python-checkins mailing list