gh-118422: Fix run_fileexflags() test#118429
Conversation
Don't test undefined fileno() behavior on a closed file, but use fstat() as a reliable test if the file was closed or not.
|
!buildbot wasi |
|
🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit 4cba722 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Thank you, it LGTM if tests are passed on all platforms.
|
@serhiy-storchaka: I added _Py_IsValidFD() helper function to fix Windows. Do you want to review the updated PR? |
|
Oh, the test now fails on WASI with: |
|
Initially the check was skipped only on WASI (#117982). Then I made it only performing on Linux/Windows/macOS (#118230), because it failed on Oracle Solaris, SmartOS and OpenBSD (#117982 (comment)). |
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
Sorry, @vstinner, I could not cleanly backport this to |
Don't test the undefined behavior of fileno() on a closed file, but use fstat() as a reliable test if the file was closed or not.
|
3.12 is now security-only, so the backport is no longer needed. https://discuss.python.org/t/python-3-12-is-now-security-fix-only/87520 |
Don't test undefined fileno() behavior on a closed file, but use fstat() as a reliable test if the file was closed or not.