Issue #6050: Don't fail extracting a directory from a zipfile if

the directory already exists.
This commit is contained in:
Martin v. Löwis 2009-05-24 19:30:52 +00:00
parent 53b578eba1
commit 0b09c42ffe
3 changed files with 10 additions and 1 deletions

View file

@ -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)