]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-145335: Fix os functions when passing fd -1 as path (#145439)
authorVictor Stinner <vstinner@python.org>
Tue, 3 Mar 2026 12:57:08 +0000 (13:57 +0100)
committerGitHub <noreply@github.com>
Tue, 3 Mar 2026 12:57:08 +0000 (13:57 +0100)
commit52c8efa87d028e57895d6a44f22caeb99a589711
treeddca305d8408aadfd0b2f49372889f36f1a216cf
parentdb41717cd50af6db7d496b0aa282b1f3370327c6
gh-145335: Fix os functions when passing fd -1 as path (#145439)

os.listdir(-1) and os.scandir(-1) now fail with OSError(errno.EBADF)
rather than listing the current directory.

os.listxattr(-1) now fails with OSError(errno.EBADF) rather than
listing extended attributes of the current directory.
Doc/library/os.rst
Lib/test/test_os/test_os.py
Misc/NEWS.d/next/Library/2026-03-02-20-08-09.gh-issue-145335.lVTBvd.rst [new file with mode: 0644]
Modules/posixmodule.c