Skip to content

[3.14] gh-155905: Fix error handling in _testcapi helpers (GH-155906) - #156581

Merged
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-a175da7-3.14
Aug 29, 2026
Merged

[3.14] gh-155905: Fix error handling in _testcapi helpers (GH-155906)#156581
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-a175da7-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Py_fopen() sets an exception and returns NULL on error. The
pyobject_print*() helpers did not check the result and crashed, and the
pymarshal_*() helpers set a second exception on top of it.

The pyobject_print*() helpers which take a single argument now use
METH_O, and the result of PyUnicode_FromString() is now checked.
(cherry picked from commit a175da7)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com
Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com

…5906)

Py_fopen() sets an exception and returns NULL on error.  The
pyobject_print*() helpers did not check the result and crashed, and the
pymarshal_*() helpers set a second exception on top of it.

The pyobject_print*() helpers which take a single argument now use
METH_O, and the result of PyUnicode_FromString() is now checked.
(cherry picked from commit a175da7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added skip news type-crash A hard crash of the interpreter, possibly with a core dump labels Aug 29, 2026
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) August 29, 2026 16:03
@serhiy-storchaka
serhiy-storchaka merged commit c392157 into python:3.14 Aug 29, 2026
53 checks passed
@miss-islington
miss-islington deleted the backport-a175da7-3.14 branch August 29, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news type-crash A hard crash of the interpreter, possibly with a core dump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants