Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support qualified referencing for ntpath.abspath() #126782

Copy link
Copy link
Open
@nineteendo

Description

@nineteendo
Issue body actions

Feature or enhancement

Proposal:

from @eryksun (#117855 (comment)):

Offhand I can't remember why normpath() gets called first. The fact that it removes an initial "." component is even more of a nuisance now. It prevents qualified referencing of files with certain DOS device names in the working directory such as "./con" versus unqualified "con". Support for the latter was added in Windows 11. For example:

>>> nt._getfullpathname('./con')
'C:\\Temp\\con'
>>> nt._getfullpathname('con')
'\\\\.\\con'
>>> os.path.abspath('./con')
'\\\\.\\con'

Calling normpath() first was always an issue for unambiguous references to file streams of single-letter filenames in the current directory. For example:

>>> nt._getfullpathname('./Z:spam')
'C:\\Temp\\Z:spam'
>>> os.path.abspath('./Z:spam')
'Z:\\spam'

Windows would beg to differ about the significance of a leading "." component, in these cases and others. Anyway, I thought this version could at least address the inconsistent behavior with embedded null characters, while still calling normpath() first.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.