Skip to content

gh-157242: Add byteswriter_check_consistency() - #157723

Merged
vstinner merged 3 commits into
python:mainfrom
vstinner:bytes_mutate
Sep 18, 2026
Merged

vstinner merged 3 commits into
python:mainfrom
vstinner:bytes_mutate

Conversation

@vstinner

@vstinner vstinner commented Sep 18, 2026

Copy link
Copy Markdown
Member

Add byteswriter_check_consistency() to check that the bytes/bytearray object can be mutated. It is called by all PyBytesWriter functions.

  • Add test_thread to PyBytesWriter tests.
  • _PyBytes_IsMutable() now checks _PyObject_IsUniquelyReferenced().

Add byteswriter_check_consistency() to check that the bytes/bytearray
object can be mutated. It is called by all PyBytesWriter functions.

* Add test_thread to PyBytesWriter tests.
* _PyBytes_IsMutable() now checks _PyObject_IsUniquelyReferenced().
Check PyBytesWriter consistency in more places.

Skip test_thread() if threading doesn't work.
@vstinner
vstinner enabled auto-merge (squash) September 18, 2026 02:11
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34625469 | 📁 Comparing aba957a against main (8542958)

  🔍 Preview build  

1 file changed
± c-api/bytes.html

@vstinner
vstinner merged commit e2ff498 into python:main Sep 18, 2026
54 checks passed
@vstinner
vstinner deleted the bytes_mutate branch September 18, 2026 02:43
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