From 29844ff1113b4d37023db448f1ef7080cbe029ae Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 20 Mar 2014 22:53:11 +0100 Subject: [PATCH] Detect broken symlinks when unpacking. --- doc/changelog.txt | 5 +++++ patoolib/__init__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index c297735..eab346c 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -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. diff --git a/patoolib/__init__.py b/patoolib/__init__.py index b537095..e0be6ac 100644 --- a/patoolib/__init__.py +++ b/patoolib/__init__.py @@ -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)