summaryrefslogtreecommitdiff
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2007-08-28 12:31:09 +0000
committerLars Gustäbel <lars@gustaebel.de>2007-08-28 12:31:09 +0000
commit0f4a14b56fcbd939e60f424517db61ca6f2f3885 (patch)
tree3b08b8518232c5786117dc5056baf9d10d3b31d5 /Lib/tarfile.py
parent23b8ddc110ec980e62a30d3e28678e4b75fed10e (diff)
downloadcpython-git-0f4a14b56fcbd939e60f424517db61ca6f2f3885.tar.gz
TarFile.__init__() no longer fails if no name argument is passed and
the fileobj argument has no usable name attribute (e.g. StringIO). (will backport to 2.5)
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 1ab13f0e41..ee9922c60a 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1522,7 +1522,7 @@ class TarFile(object):
if hasattr(fileobj, "mode"):
self._mode = fileobj.mode
self._extfileobj = True
- self.name = os.path.abspath(name)
+ self.name = os.path.abspath(name) if name else None
self.fileobj = fileobj
# Init attributes.