]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-109613: _pystat_fromstructstat() checks for exceptions (#109618)
authorVictor Stinner <vstinner@python.org>
Thu, 21 Sep 2023 07:55:06 +0000 (09:55 +0200)
committerGitHub <noreply@github.com>
Thu, 21 Sep 2023 07:55:06 +0000 (09:55 +0200)
commitd4cea794a7b9b745817d2bd982d35412aef04710
tree040c625f4d2bd4f4a332227ecf7982b539242b51
parent115c49ad5a5ccfb628fef3ae06a566f7a0197f97
gh-109613: _pystat_fromstructstat() checks for exceptions (#109618)

Fix os.stat() and os.DirEntry.stat(): check for exceptions.
Previously, on Python built in debug mode, these functions could
trigger a fatal Python error (and abort the process) when a function
succeeded with an exception set.

_pystat_fromstructstat() now exits immediately if an exception is
raised, rather only checking for exceptions at the end. It fix
following fatal error in fill_time():

    Fatal Python error: _Py_CheckSlotResult:
    Slot * of type int succeeded with an exception set
Misc/NEWS.d/next/Library/2023-09-20-17-45-46.gh-issue-109613.P13ogN.rst [new file with mode: 0644]
Modules/posixmodule.c