Skip to content

gh-116738: Make csv module thread-safe - #141365

Merged
colesbury merged 1 commit into
python:mainfrom
yoney:ft_csv
Nov 21, 2025
Merged

gh-116738: Make csv module thread-safe#141365
colesbury merged 1 commit into
python:mainfrom
yoney:ft_csv

Conversation

@yoney

@yoneyyoney commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Added a critical section to protect the states of ReaderObj and WriterObj in the free-threading build. Without the critical sections, both new free-threading tests were crashing. Also ran the tests with tsan.

cc: @mpage@colesbury

@colesburycolesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@colesbury
colesbury merged commit fb26d9c into python:mainNov 21, 2025
56 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @yoney for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 21, 2025
Added a critical section to protect the states of `ReaderObj` and `WriterObj` in the free-threading build. Without the critical sections, both new free-threading tests were crashing.
(cherry picked from commit fb26d9c)
Co-authored-by: Alper <alperyoney@fb.com>
@bedevere-app

Copy link
Copy Markdown

GH-141825 is a backport of this pull request to the 3.14 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.14 bugs and security fixes label Nov 21, 2025
colesbury pushed a commit that referenced this pull request Nov 21, 2025
Added a critical section to protect the states of `ReaderObj` and `WriterObj` in the free-threading build. Without the critical sections, both new free-threading tests were crashing.
(cherry picked from commit fb26d9c)
Co-authored-by: Alper <alperyoney@fb.com>
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Added a critical section to protect the states of `ReaderObj` and `WriterObj` in the free-threading build. Without the critical sections, both new free-threading tests were crashing.
ashm-dev pushed a commit to ashm-dev/cpython that referenced this pull request Dec 8, 2025
Added a critical section to protect the states of `ReaderObj` and `WriterObj` in the free-threading build. Without the critical sections, both new free-threading tests were crashing.
@yoney
yoney deleted the ft_csv branch January 27, 2026 17:07
Sign up for freeto 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.

2 participants

@yoney@colesbury