diff options
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/archive.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/archive.py b/django/utils/archive.py index ea948fe44f..9c2d4ac01b 100644 --- a/django/utils/archive.py +++ b/django/utils/archive.py @@ -141,7 +141,7 @@ class TarArchive(BaseArchive): name = self.split_leading_dir(name)[1] filename = os.path.join(to_path, name) if member.isdir(): - if not os.path.exists(filename): + if filename and not os.path.exists(filename): os.makedirs(filename) else: try: @@ -153,7 +153,7 @@ class TarArchive(BaseArchive): (name, member.name, sys.exc_info()[1])) else: dirname = os.path.dirname(filename) - if not os.path.exists(dirname): + if dirname and not os.path.exists(dirname): os.makedirs(dirname) with open(filename, 'wb') as outfile: shutil.copyfileobj(extracted, outfile) |
