[issue41448] pathlib behave differ between OS

Ronald Oussoren report at bugs.python.org
Fri Jul 31 08:06:15 EDT 2020


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

PureWindowsPath does not know about POSIX paths, it supports the two styles of directory separator that are valid on Windows: '/' and '\'. 

PurePosixPath only supports the single stile of directory separator valid on POSIX systems: '/'. 

On a Posix system backslash is a valid character in a file name and is NOT a directory separator.


The behaviour of Path.resolve() on Windows may or may not be a bug, the documentation is not quite clear. Personally I'd lean toward saying this is a bug, but I defer to a pathlib expert.  Note that path.resolve(strict=True) should raise an error on both platforms when the path does not exists.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41448>
_______________________________________


More information about the Python-bugs-list mailing list