Behaviour of os.path.join
Rhodri James
rhodri at kynesim.co.uk
Tue May 26 13:18:54 EDT 2020
On 26/05/2020 18:01, BlindAnagram wrote:
> On 26/05/2020 17:09, Stefan Ram wrote:
>> Mats Wichmann <mats at python.org> writes:
>>> an absolute path is one that starts with the pathname separator.
>>
>> The Python Library Reference does not use the term
>> "pathname separator". It uses "directory separator"
>> (os.sep) and "filename separator" ('/' on Unix).
>>
>> On Windows:
>>
>> |>>> import pathlib
>> |>>> import os
>> |>>> pathlib.PureWindowsPath('\\').is_absolute()
>> |False
>> |>>> pathlib.PureWindowsPath(os.sep).is_absolute()
>> |False
>> |>>> pathlib.PureWindowsPath('/').is_absolute()
>> |False
>
> Thanks, that seems to suggest that there is an issue and that I should
> hence submit this as an issue.
It is indeed most curious as to why this obviously absolute path is not
recognised as such :-)
--
Rhodri James *-* Kynesim Ltd
More information about the Python-list
mailing list