Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-140739: Fix missing exception on allocation failure in BinaryWriter#143204

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pablogsal merged 1 commit intopython:mainfrompablogsal:tachyon-memsafe
Dec 27, 2025

Conversation

@pablogsal
Copy link
Member

@pablogsalpablogsal commentedDec 27, 2025
edited by bedevere-appbot
Loading

The binary_writer_create function had several error paths where memory
allocation failures would return NULL without setting a Python exception.
This violated the C API contract and caused "returning an error without
exception set" errors when BinaryWriter initialization failed due to
memory pressure.

Added PyErr_NoMemory calls before each goto error for PyMem_Malloc and
_Py_hashtable_new_full failures. Neither of these functions set exceptions
on failure, so callers must do it explicitly. The error label only performs
cleanup and returns NULL, relying on exceptions being set beforehand.

…yWriterThe binary_writer_create function had several error paths where memoryallocation failures would return NULL without setting a Python exception.This violated the C API contract and caused "returning an error withoutexception set" errors when BinaryWriter initialization failed due tomemory pressure.Added PyErr_NoMemory calls before each goto error for PyMem_Malloc and_Py_hashtable_new_full failures. Neither of these functions set exceptionson failure, so callers must do it explicitly. The error label only performscleanup and returns NULL, relying on exceptions being set beforehand.
@pablogsalpablogsalenabled auto-merge (squash)December 27, 2025 01:18
@pablogsalpablogsal merged commit5436289 intopython:mainDec 27, 2025
48 checks passed
@pablogsalpablogsal deleted the tachyon-memsafe branchDecember 27, 2025 01:39
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@pablogsal

[8]ページ先頭

©2009-2026 Movatter.jp