Detect broken symlinks when unpacking.

This commit is contained in:
Bastian Kleineidam 2014-03-20 22:53:11 +01:00
parent 221b89f0ed
commit 29844ff111
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
1.5 (released xx.xx.2014)
* Fix detection of existing broken symlinks when unpacking.
1.4 (released 2.9.2013)
* Add missing GZIP creation support for 7z modules.

View File

@ -385,7 +385,7 @@ def move_outdir_orphan (outdir):
if len(entries) == 1:
src = os.path.join(outdir, entries[0])
dst = os.path.join(os.path.dirname(outdir), entries[0])
if os.path.exists(dst):
if os.path.exists(dst) or os.path.islink(dst):
return (False, "local file exists")
shutil.move(src, dst)
os.rmdir(outdir)