Skip to content

Conversation

@cmaloney
Copy link
Contributor

@cmaloney cmaloney commented Dec 19, 2025

This backport is more intricate as free threading / locking / critical sections was only added to bytearray in 3.14. This drops all critical section pieces (thread-safety for bytearray was added in 3.14)

this makes bytearray safer in 3.13 (The methods that use _bytearray_with_buffer should now be thread safe as it does the critical section), but I did not make all the methods thread safe that are thread safe in 3.14 (Without the clinic annotation doing so well is a lot more difficult)

(cherry picked from commit 220f0b1)

… by exporting buffer in bytearray (pythonGH-142938)

(cherry picked from commit 220f0b1)

Co-authored-by: wangxiaolei <[email protected]>
@vstinner
Copy link
Member

Sadly, the build fails :-(

@cmaloney
Copy link
Contributor Author

cmaloney commented Dec 19, 2025

Will work on resolving in a bit; free threaded build worked for me... i need to improve my local tools for doing multiple builds

@cmaloney
Copy link
Contributor Author

Updated to drop the critical sections / locking

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM. 👍

But the NEWS entry should be in the Core and Builtins section.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. We don't support Free Threading in Python 3.13.

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) December 24, 2025 19:01
@serhiy-storchaka serhiy-storchaka merged commit a9e068f into python:3.13 Dec 24, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants