summaryrefslogtreecommitdiff
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 261d9fbc36..474e306e4c 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1044,7 +1044,9 @@ class TarFile(object):
can be determined, `mode' is overridden by `fileobj's mode.
`fileobj' is not closed, when TarFile is closed.
"""
- self.name = os.path.abspath(name)
+ self.name = name
+ if self.name is not None:
+ self.name = os.path.abspath(name)
if len(mode) > 1 or mode not in "raw":
raise ValueError("mode must be 'r', 'a' or 'w'")