gh-145335: Fix os functions when passing fd -1 as path#145439
gh-145335: Fix os functions when passing fd -1 as path#145439vstinner merged 5 commits intopython:mainfrom
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.
|
🤖 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. |
|
Tests failed on 5 buildbots, but failures are unrelated to this change.
3 tests failed: |
Inline check_for_ebadf().
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?)
|
Merged. Thanks for the review! |
I had a look and I didn't find other places with the same bug.
|
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