Skip to content

pathlib.PureWindowsPath.is_absolute() can return False for UNC paths #105476

Closed

Description

@barneygale

return bool(self.drive and self.root)

Per @eryksun:

Note that this check is wrong for incomplete UNC paths such as "//", "//spam", "//?/UNC/", and "//?/UNC/spam". Such paths lack a root and don't even have an implicit root. However, they're still absolute because they don't depend on the current working directory. I don't know how or whether you want to handle this edge case.

ntpath.isabs() gets this case right, but it's still wrong for rooted paths such as "/spam".

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Nov 23, 2023
  2. added 3 commits that reference this issue on Jan 8, 2024
  3. barneygale commented on Jan 13, 2024

    @barneygale
    ContributorAuthor

    Fixed in 3.13+ / e4ff131 / #113829

  4. added a commit that references this issue on Jan 22, 2024
  5. added a commit that references this issue on Feb 11, 2024
  6. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions