Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple,
by denying s# to parse objects that have a releasebuffer procedure,
and introducing s*.
More module might need to get converted to use s*.
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 6d53a09..5bf4add 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -1328,7 +1328,8 @@
static int
string_buffer_getbuffer(PyStringObject *self, Py_buffer *view, int flags)
{
- return PyBuffer_FillInfo(view, (void *)self->ob_sval, Py_SIZE(self),
+ return PyBuffer_FillInfo(view, (PyObject*)self,
+ (void *)self->ob_sval, Py_SIZE(self),
1, flags);
}
@@ -1359,7 +1360,7 @@
};
-
+
#define LEFTSTRIP 0
#define RIGHTSTRIP 1
#define BOTHSTRIP 2
@@ -3996,7 +3997,7 @@
\n\
");
-
+
static PyMethodDef
string_methods[] = {
/* Counterparts of the obsolete stropmodule functions; except