mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 02:43:43 +03:00
Dropped GIL release around function calling PyMem_Malloc
Closes ticket #110.
This commit is contained in:
parent
ba1fe6fff6
commit
7982a6ac0b
3
NEWS
3
NEWS
|
@ -4,6 +4,9 @@ What's new in psycopg 2.4.6
|
|||
- Fixed 'cursor()' arguments propagation in connection subclasses
|
||||
and overriding of the 'cursor_factory' argument. Thanks to
|
||||
Corry Haines for the report and the initial patch (ticket #105).
|
||||
- Dropped GIL release during string adaptation around a function call
|
||||
invoking a Python API function, which could cause interpreter crash.
|
||||
Thanks to Manu Cupcic for the report (ticket #110).
|
||||
|
||||
|
||||
What's new in psycopg 2.4.5
|
||||
|
|
|
@ -73,16 +73,7 @@ qstring_quote(qstringObject *self)
|
|||
|
||||
/* encode the string into buffer */
|
||||
Bytes_AsStringAndSize(str, &s, &len);
|
||||
|
||||
/* Call qstring_escape with the GIL released, then reacquire the GIL
|
||||
before verifying that the results can fit into a Python string; raise
|
||||
an exception if not. */
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
buffer = psycopg_escape_string(self->conn, s, len, NULL, &qlen);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (buffer == NULL) {
|
||||
if (!(buffer = psycopg_escape_string(self->conn, s, len, NULL, &qlen))) {
|
||||
Py_DECREF(str);
|
||||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue
Block a user