Skip to content

gh-85004: Add the printname parameter in os.readlink() - #155425

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-85004-readlink-printname
Open

gh-85004: Add the printname parameter in os.readlink()#155425
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-85004-readlink-printname

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 9, 2026

Copy link
Copy Markdown
Member

The print name is optional -- [MS-FSCC] only says that it SHOULD be set, and PowerShell's New-Item -ItemType Junction does not set one -- so the substitute name is returned for a link which has none. Converting the \??\ prefix to \\?\ is skipped for the print name, which is not in the NT namespace. On non-Windows platforms the parameter is ignored, as a POSIX symlink has only one target path.

On Windows it makes the function return the print name of the link --
the target path as it was specified when the link was created.
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33980043 | 📁 Comparing 5c5a96c against main (998b890)

  🔍 Preview build  

3 files changed
± library/os.html
± whatsnew/3.16.html
± whatsnew/changelog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant