Uh oh!
There was an error while loading. Please reload this page.
gh-145335: Fix os functions when passing fd -1 as path - #145439
Conversation
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.
bedevere-bot
commented
Mar 2, 2026
🤖 New build scheduled with the buildbot fleet by @vstinner for commit a894262 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F145439%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
vstinner
commented
Mar 3, 2026
Tests failed on 5 buildbots, but failures are unrelated to this change.
3 tests failed: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
picnixz
left a comment
There was a problem hiding this comment.
LGTM! Are there actually other places where we use the path converter and that would be useful? (that is, do you plan to look at other modules as follow-up?)
vstinner
commented
Mar 3, 2026
Merged. Thanks for the review! |
vstinner
commented
Mar 3, 2026
I had a look and I didn't find other places with the same bug.
|
freakboy3742
commented
Mar 5, 2026
This appears to have broken Emscripten builds; not sure if the fix is a test skip, or if there's some additional handling required. /cc @hoodmane |
hoodmane
commented
Mar 5, 2026
I'll look into it, thanks for the ping @freakboy3742. |
hoodmane
commented
Mar 5, 2026
Problem seems to be that on Emscripten |
hoodmane
commented
Mar 5, 2026
Fix here: #145528 |
vstinner
commented
Mar 5, 2026
Oh, I missed this buildbot failure since it's still classified as Unstable. I propose to promote it to Stable: python/buildmaster-config#678. |
…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.
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.
os.pathconf(-1, 1)#145335