Index: Objects/stringobject.c =================================================================== --- Objects/stringobject.c (révision 65930) +++ Objects/stringobject.c (copie de travail) @@ -812,6 +812,10 @@ if (flags & Py_PRINT_RAW) { char *data = op->ob_sval; Py_ssize_t size = Py_SIZE(op); +#if defined(Py_DEBUG) + PyGILState_STATE gil; + gil = PyGILState_Ensure(); +#endif Py_BEGIN_ALLOW_THREADS while (size > INT_MAX) { /* Very long strings cannot be written atomically. @@ -829,6 +833,9 @@ fwrite(data, 1, (int)size, fp); #endif Py_END_ALLOW_THREADS +#if defined(Py_DEBUG) + PyGILState_Release(gil); +#endif return 0; }