gh-155742: Use PyBytesWriter in _Py_strhex_impl() #157734

Closed
vstinner opened 11:17pm on September 17, 2026 wanted to merge 1 commit into python/cpython main from
writer_strhex
Diff Delta:
0
About 39 Diff Delta/hour
Classified as:  General

vstinner's Description of Work

Replace soft deprecated PyBytes_FromStringAndSize() with PyBytesWriter.

Replace also PyBytes_FromStringAndSize(NULL, 0) with Py_GetConstant(Py_CONSTANT_EMPTY_BYTES) in other functions.

Replace also PyBytes_FromStringAndSize(NULL, 0) with PyBytes_FromStringAndSize("", 0) in _Py_GetConstant_Init().


  • Issue: gh-155742
    <!-- /gh-issue-number -->

5 total changed files
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
You’ve reached the end
Reviewer: 1. Additional work: 0