diff Objects/stringobject.c @ 48221:b8c4bf393794 legacy-trunk

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*.
author Martin v. Löwis <martin@v.loewis.de>
date Tue, 12 Aug 2008 14:49:50 +0000
parents 97607fcb7b26
children b5365f34640f
line wrap: on
line diff
--- a/Objects/stringobject.c	Tue Aug 12 12:41:45 2008 +0000
+++ b/Objects/stringobject.c	Tue Aug 12 14:49:50 2008 +0000
@@ -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