]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-109613: _pystat_fromstructstat() checks for exceptions (#109618) (#109668)
authorVictor Stinner <vstinner@python.org>
Thu, 21 Sep 2023 18:00:38 +0000 (20:00 +0200)
committerGitHub <noreply@github.com>
Thu, 21 Sep 2023 18:00:38 +0000 (18:00 +0000)
commit0c79353e1154eeb6a8a46e42a1a5d6884bd3f2ab
tree2effa7cd2ffa2270d3ca3193bed30e1280769f25
parente918b19f420740fbc19bf29975362178d97ab209
[3.11] gh-109613: _pystat_fromstructstat() checks for exceptions (#109618) (#109668)

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

(cherry picked from commit d4cea794a7b9b745817d2bd982d35412aef04710)
Misc/NEWS.d/next/Library/2023-09-20-17-45-46.gh-issue-109613.P13ogN.rst [new file with mode: 0644]
Modules/posixmodule.c