[ python-Bugs-1706850 ] tarfile fails in 2.5.1 (NoneType has no ...)

SourceForge.net noreply at sourceforge.net
Tue Apr 24 22:44:55 CEST 2007


Bugs item #1706850, was opened at 2007-04-24 20:53
Message generated for change (Comment added) made by gustaebel
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1706850&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 7
Private: No
Submitted By: Thomas Leonard (tal197)
Assigned to: Lars Gustäbel (gustaebel)
Summary: tarfile fails in 2.5.1 (NoneType has no ...)

Initial Comment:
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,

----------------------------------------------------------------------

>Comment By: Lars Gustäbel (gustaebel)
Date: 2007-04-24 22:44

Message:
Logged In: YES 
user_id=642936
Originator: NO

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

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2007-04-24 22:31

Message:
Logged In: YES 
user_id=849994
Originator: NO

Lars?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1706850&group_id=5470


More information about the Python-bugs-list mailing list