Skip to content

gh-160904: Correct os.path.normcase documentation for POSIX - #160912

Draft
GUOZIJAN wants to merge 2 commits into
python:mainfrom
GUOZIJAN:gh-160904-normcase-docs
Draft

GUOZIJAN wants to merge 2 commits into
python:mainfrom
GUOZIJAN:gh-160904-normcase-docs

Conversation

@GUOZIJAN

@GUOZIJAN GUOZIJAN commented Oct 29, 2026 •

Copy link
Copy Markdown

Fixes #160904.

os.path.normcase on POSIX does not return the path unchanged: it calls os.fspath, which normalizes path-like objects to str or bytes. This updates both the docstring in Lib/posixpath.py and Doc/library/os.path.rst to say so.

⚠️ I have not signed the PSF CLA yet (no prior contributions to CPython from this account); happy to sign it if a core dev wants to move forward with this fix.

os.path.normcase does not do nothing on POSIX: it calls os.fspath,
which normalizes path-like objects to str or bytes. Say so in the
docstring and in the documentation, instead of claiming that the
path is returned unchanged.
@python-cla-bot

python-cla-bot Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Oct 29, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@StanFromIreland

Copy link
Copy Markdown
Member

Please sign the CLA, we can't review otherwise.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35503690 | 📁 Comparing 68f093f against main (8a5e24a)

  🔍 Preview build  

1 file changed
± library/os.path.html

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

os.path.normcase incorrectly claims to do nothing

2 participants

⌂ Proxy