28 Apr
2011
28 Apr
'11
4:20 p.m.
Hi, I’m still educating myself about concurrency and race conditions, so I hope my naïve question won’t be just a waste of time. Here it is:
http://hg.python.org/cpython/rev/0c8bc3a0130a user: Senthil Kumaran
summary: Fix closes issue10761: tarfile.extractall failure when symlinked files are present.
diff --git a/Lib/tarfile.py b/Lib/tarfile.py --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -2239,6 +2239,8 @@ if hasattr(os, "symlink") and hasattr(os, "link"): # For systems that support symbolic and hard links. if tarinfo.issym(): + if os.path.exists(targetpath): + os.unlink(targetpath)
Is there a race condition here? Thanks Regards