This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tarfile fails in 2.5.1 (NoneType has no ...)
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: lars.gustaebel Nosy List: georg.brandl, lars.gustaebel, tal197
Priority: high Keywords:

Created on 2007-04-24 18:53 by tal197, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
r54889.diff lars.gustaebel, 2007-04-24 20:44 Changes from r54889.
Messages (4)
msg31878 - (view) Author: Thomas Leonard (tal197) Date: 2007-04-24 18:53
In Python 2.5.1's tarfile.py, we have:

def __init__(self, name=None, mode="r", fileobj=None):
        self.name = os.path.abspath(name)

If name is None (e.g. extracting from a stream) we get e.g.:

Traceback (most recent call last):
  File "tarfile.py", line 1168, in open
    _Stream(name, filemode, comptype, fileobj, bufsize))
  File "tarfile.py", line 1047, in __init__
    self.name = os.path.abspath(name)
  File "posixpath.py", line 402, in abspath
    if not isabs(path):
  File "posixpath.py", line 49, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

It works with Python 2.3.6, 2.4.4 and 2.5.0, but not 2.5.1.

(discovered by Zero Install unit-tests)

Thanks,
msg31879 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-04-24 20:31
Lars?
msg31880 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2007-04-24 20:44
Apparently this is a duplicate of #1695229. It was fixed in rev. 54889 in release25-maint, about a week too late for 2.5.1 :-(
I attached a patch with the changes.
File Added: r54889.diff
msg31881 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-04-24 20:56
Okay, closing then.
History
Date User Action Args
2022-04-11 14:56:24adminsetgithub: 44893
2007-04-24 18:53:18tal197create