]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-109613: _pystat_fromstructstat() checks for exceptions (GH-109618) (#109641)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 2 Oct 2023 15:09:45 +0000 (08:09 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Oct 2023 15:09:45 +0000 (17:09 +0200)
commit47e96c6782f6751e8a09991909073039b867d10c
tree69f36ad40d6ecd2fa383f4d9549e9849327659f0
parentdc70d30732fda7e88d7c38917968f59415a3f534
[3.12] gh-109613: _pystat_fromstructstat() checks for exceptions (GH-109618) (#109641)

gh-109613: _pystat_fromstructstat() checks for exceptions (GH-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)

Co-authored-by: Victor Stinner <vstinner@python.org>
Misc/NEWS.d/next/Library/2023-09-20-17-45-46.gh-issue-109613.P13ogN.rst [new file with mode: 0644]
Modules/posixmodule.c