Index: Python/marshal.c =================================================================== --- Python/marshal.c (revision 75155) +++ Python/marshal.c (working copy) @@ -66,6 +66,7 @@ Py_ssize_t size, newsize; if (p->str == NULL) return; /* An error already occurred */ + Py_BEGIN_ALLOW_THREADS size = PyString_Size(p->str); newsize = size + size + 1024; if (newsize > 32*1024*1024) { @@ -80,6 +81,7 @@ PyString_AS_STRING((PyStringObject *)p->str) + newsize; *p->ptr++ = Py_SAFE_DOWNCAST(c, int, char); } + Py_END_ALLOW_THREADS } static void