mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
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)
This commit is contained in:
parent
23b8ddc110
commit
0f4a14b56f
3 changed files with 19 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue