Skip to content

gh-155742: Use PyBytesWriter in _zstd.finalize_dict() - #157343

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:zstd
Sep 14, 2026
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:zstd

Conversation

@vstinner

@vstinner vstinner commented Sep 12, 2026

Copy link
Copy Markdown
Member

Replace soft deprecated _PyBytes_Resize() with PyBytesWriter.

Replace soft deprecated PyBytes_FromStringAndSize() with
PyBytesWriter.
@vstinner

Copy link
Copy Markdown
Member Author

I already made a similar change for _zstd.train_dict(): merged PR gh-155745.

PyBytesWriter_Discard(dst_dict_bytes);

success:
done:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed "success:" label to "done:" since we can reach this label with NULL result: PyBytesWriter_FinishWithSize() can fail and return NULL.

@vstinner
vstinner merged commit c674116 into python:main Sep 14, 2026
55 checks passed
@vstinner
vstinner deleted the zstd branch September 14, 2026 21:56
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