summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2009-05-24 19:30:52 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2009-05-24 19:30:52 (GMT)
commit0b09c42ffec7b56b7f94c11d160ca083944c9cf8 (patch)
tree3dab68c17b8d22e1ad26666e167118e3dcdca117 /Lib/zipfile.py
parent53b578eba14d377e75ebe7cfd93a644f7ac42057 (diff)
downloadcpython-0b09c42ffec7b56b7f94c11d160ca083944c9cf8.zip
cpython-0b09c42ffec7b56b7f94c11d160ca083944c9cf8.tar.gz
cpython-0b09c42ffec7b56b7f94c11d160ca083944c9cf8.tar.bz2
Issue #6050: Don't fail extracting a directory from a zipfile if
the directory already exists.
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index e3d40b4..68885f9 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -971,7 +971,8 @@ class ZipFile:
os.makedirs(upperdirs)
if member.filename[-1] == '/':
- os.mkdir(targetpath)
+ if not os.path.isdir(targetpath):
+ os.mkdir(targetpath)
return targetpath
source = self.open(member, pwd=pwd)