Skip to content

pathlib: inconsistent handling of rootless Windows paths #94909

Description

@barneygale
>>> from pathlib import PureWindowsPath
>>> a = 'C:/a/b'
>>> b = 'C:x/y'
>>> PureWindowsPath(a, b)
PureWindowsPath('C:x/y')
>>> PureWindowsPath(a) / b
PureWindowsPath('C:/a/b/x/y')

Seems to be the only case where the PureWindowsPath constuctor and joinpath() disagree when given the same arguments. This has implications for future work, so I'd love to make them consistent.

Affects all supported versions of Python.

Metadata

Metadata

Assignees

Labels

OS-windowsstdlibStandard Library Python modules in the Lib/ directorytopic-pathlibtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions