python / cpython

The Python programming language
https://www.python.org/
Other
60.06k stars 29.08k forks source link

gh-118422: Fix run_fileexflags() test #118429

Closed vstinner closed 2 weeks ago

vstinner commented 2 weeks ago

Don't test undefined fileno() behavior on a closed file, but use fstat() as a reliable test if the file was closed or not.

serhiy-storchaka commented 2 weeks ago

!buildbot wasi

bedevere-bot commented 2 weeks ago

:robot: New build scheduled with the buildbot fleet by @serhiy-storchaka for commit 4cba722454901c4ca20ad7d8de72d2dd30b609f1 :robot:

The command will test the builders whose names match following regular expression: wasi

The builders matched are:

vstinner commented 2 weeks ago

@serhiy-storchaka: I added _Py_IsValidFD() helper function to fix Windows. Do you want to review the updated PR?

vstinner commented 2 weeks ago

Oh, the test now fails on WASI with:

test_run_fileexflags (test.test_capi.test_run.CAPITest.test_run_fileexflags) ...

Error: failed to run main module `python.wasm`

Caused by:
    0: failed to invoke command default
    1: error while executing at wasm backtrace:
           0: 0x56b06e - <unknown>!fclose
           1: 0x47526e - <unknown>!run_fileexflags
serhiy-storchaka commented 2 weeks ago

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 (https://github.com/python/cpython/pull/117982#discussion_r1574837997).

miss-islington-app[bot] commented 2 weeks ago

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. 🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington-app[bot] commented 2 weeks ago

Sorry, @vstinner, I could not cleanly backport this to 3.12 due to a conflict. Please backport using cherry_picker on command line.

cherry_picker e93c39b47ea623dfaf61f80775ad4747b163efe5 3.12