Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.11] gh-109613: _pystat_fromstructstat() checks for exceptions (#109618) #109668

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 21, 2023

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 d4cea79)

…on#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 d4cea79)
@vstinner
Copy link
Member Author

There were some merge conflicts, I picked the 3.11 code and I reapplied changes manually.

I validated manually my changes with these tests: #109618 (comment)

@vstinner vstinner enabled auto-merge (squash) September 21, 2023 17:37
@vstinner vstinner merged commit 0c79353 into python:3.11 Sep 21, 2023
@vstinner vstinner deleted the fromstructstat311 branch September 21, 2023 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant