Issue1937

classification
Title: pylint / posixpath.join fails
Type: behaviour Severity: normal
Components: Library Versions: 2.7a2
Milestone:
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, malte.vesper, pjenvey
Priority: Keywords:

Created on 2012-06-29.12:48:38 by malte.vesper, last changed 2012-06-29.20:24:24 by pjenvey.

Messages
msg7276 (view) Author: malte vesper (malte.vesper) Date: 2012-06-29.12:48:38
posixpath.join fails if the first parameter is none.
pylint uses this, suggested fix:

In the function  arround line 58 extend:
    path = a

to
    path = a or ''
msg7282 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-06-29.17:39:38
Maybe I'm not understanding this one but:


Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import posixpath
>>> posixpath.join(None, "foo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/posixpath.py", line 68, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
>>>
msg7286 (view) Author: Philip Jenvey (pjenvey) Date: 2012-06-29.20:24:19
We match the CPython behavior as Frank says. If you wanted this changed you'd have to take it up with CPython

However, None is not a valid path. join's docs states that it will "Join one or more path components intelligently."

None of the path functions allow None values. I don't see this as a valid request
History
Date User Action Args
2012-06-29 20:24:24pjenveysetresolution: fixed -> invalid
2012-06-29 20:24:19pjenveysetstatus: open -> closed
resolution: fixed
messages: + msg7286
nosy: + pjenvey
2012-06-29 17:39:38fwierzbickisetnosy: + fwierzbicki
messages: + msg7282
2012-06-29 12:48:38malte.vespercreate