GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pathlib.PureWindowsPath.is_absolute() can return False for UNC paths · Issue #105476 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
pathlib.PureWindowsPath.is_absolute() can return False for UNC paths#105476
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@barneygale
barneygale
opened on Jun 7, 2023
Issue body actions

cpython/Lib/pathlib.py

Line 692 in 264a011

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. barneygale
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    topic-pathlib
    on Jun 7, 2023
  2. iritkatriel
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Nov 23, 2023
  3. barneygale
    added this to pathlib issueson Dec 2, 2023
  4. barneygale
    moved this to Todo in pathlib issueson Dec 4, 2023
  5. barneygale
    added 3 commits that reference this issue on Jan 8, 2024

    pythonGH-44626, pythonGH-105476: Fix `ntpath.isabs()` handling of par…

    2ab3656

    pythonGH-44626, pythonGH-105476: Fix `ntpath.isabs()` handling of par…

    2100e3e

    GH-44626, GH-105476: Fix `ntpath.isabs()` handling of part-absolute p…

    e4ff131
  6. barneygale commented on Jan 13, 2024

    @barneygale
    barneygale
    on Jan 13, 2024
    ContributorAuthor
    More actions

    Fixed in 3.13+ / e4ff131 / #113829

  7. barneygale
    closed this as completedon Jan 13, 2024
  8. github-project-automation
    moved this from Todo to Done in pathlib issueson Jan 13, 2024
  9. kulikjak
    added a commit that references this issue on Jan 22, 2024

    pythonGH-44626, pythonGH-105476: Fix `ntpath.isabs()` handling of par…

    7fbe155
  10. aisk
    added a commit that references this issue on Feb 11, 2024

    pythonGH-44626, pythonGH-105476: Fix `ntpath.isabs()` handling of par…

    d1160d6
  11. Glyphack
    added a commit that references this issue on Sep 2, 2024

    pythonGH-44626, pythonGH-105476: Fix `ntpath.isabs()` handling of par…

    29f3174
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/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • pathlib issues
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.