diff -r 9332a545ad85 Lib/tarfile.py --- a/Lib/tarfile.py Thu Mar 12 22:01:30 2015 +0200 +++ b/Lib/tarfile.py Thu Mar 12 16:58:09 2015 -0500 @@ -2087,10 +2087,10 @@ # Create all upper directories. upperdirs = os.path.dirname(targetpath) - if upperdirs and not os.path.exists(upperdirs): + if upperdirs: # Create directories that are not part of the archive with # default permissions. - os.makedirs(upperdirs) + os.makedirs(upperdirs, exist_ok = True) if tarinfo.islnk() or tarinfo.issym(): self._dbg(1, "%s -> %s" % (tarinfo.name, tarinfo.linkname))