[issue35223] Pathlib incorrectly merges strings.

Eric V. Smith report at bugs.python.org
Mon Nov 12 19:27:20 EST 2018


Eric V. Smith <eric at trueblade.com> added the comment:

As far as which path components are returned, I think this is working as designed. The documentation for os.path.join says:

"""
If a component is an absolute path, all previous components are thrown away and joining continues from the absolute path component.

On Windows, the drive letter is not reset when an absolute path component (e.g., r'\foo') is encountered.
"""

pathlib's documentation for creating PurePath objects says:

"""
When several absolute paths are given, the last is taken as an anchor (mimicking os.path.join()’s behaviour)
"""

----------
nosy: +eric.smith

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


More information about the Python-bugs-list mailing list