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

Pull Request Overview

  • Opened on September 18, 2026
  • Status Closed
  • Commit count 1 with first commit September 18, 2026

Total Delta

0 Total Diff Delta

Open Days

Open 0 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Data pending calculation for pull request

Author avatar

gh-155742: Use PyBytesWriter in _Py_strhex_impl()

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 -->

PR was closed without comments.