From: Kumar Aditya Date: Sat, 23 May 2026 08:57:13 +0000 (+0530) Subject: gh-149816: add missing critical section on self in buffered_iternext (#150295) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=e8545ed3eafbf349b51ea308126a67dc70416a62;p=thirdparty%2FPython%2Fcpython.git gh-149816: add missing critical section on self in buffered_iternext (#150295) --- diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 0fdae7b2d210..5537947f6a51 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,