Skip to content

Fix error message for ntpath.commonpath #117381

Closed
@nineteendo

Description

@nineteendo

Bug report

Bug description:

>>> import ntpath
>>> ntpath.commonpath(["/foo", "foo"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen ntpath>", line 808, in commonpath
ValueError: Can't mix absolute and relative paths

/foo is not an absolute path, but a rooted path, which can't be mixed with not-rooted paths.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions