Skip to content

gh-158585: Adjust allocation in bytes_fromformat() - #158621

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:bytes_fromformat
Oct 2, 2026
Merged

vstinner merged 2 commits into
python:mainfrom
vstinner:bytes_fromformat

Conversation

@vstinner

@vstinner vstinner commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Take in account preallocated bytes when calling
PyBytesWriter_GrowAndUpdatePointer().

Use sprintf() return value instead of calling strlen().

Take in account preallocated bytes when calling
PyBytesWriter_GrowAndUpdatePointer().

Use sprintf() return value instead of calling strlen().
@vstinner
vstinner merged commit 1a85213 into python:main Oct 2, 2026
51 checks passed
@vstinner
vstinner deleted the bytes_fromformat branch October 2, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant