https://github.com/python/cpython/commit/ca59d7511e2484fc55b1686b5a8e745322db73ec
commit: ca59d7511e2484fc55b1686b5a8e745322db73ec
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2026-05-23T09:25:56Z
summary:

[3.15] gh-149816: add missing critical section on self in buffered_iternext 
(GH-150295) (#150305)

gh-149816: add missing critical section on self in buffered_iternext (GH-150295)
(cherry picked from commit e8545ed3eafbf349b51ea308126a67dc70416a62)

Co-authored-by: Kumar Aditya <[email protected]>

files:
M Modules/_io/bufferedio.c

diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index 0fdae7b2d210040..5537947f6a51c11 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -1509,7 +1509,9 @@ buffered_iternext(PyObject *op)
         tp == state->PyBufferedRandom_Type)
     {
         /* Skip method call overhead for speed */
+        Py_BEGIN_CRITICAL_SECTION(self);
         line = _buffered_readline(self, -1);
+        Py_END_CRITICAL_SECTION();
     }
     else {
         line = PyObject_CallMethodNoArgs((PyObject *)self,

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to