mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
"Fix" a few places that were using PyObject_AsCharBuffer() to convert a string
(PyUnicode these days) to a char* + length. The fix consists of calling PyUnicode_AsString() and strlen(). This is not ideal, but AsCharBuffer() is definitely not the API to use.
This commit is contained in:
parent
625cbf28ee
commit
fa9a121952
2 changed files with 9 additions and 3 deletions
|
@ -497,8 +497,10 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
|||
rc = pysqlite_statement_reset(self->statement);
|
||||
}
|
||||
|
||||
if (PyObject_AsCharBuffer(operation, &operation_cstr, &operation_len) < 0)
|
||||
operation_cstr = PyUnicode_AsString(operation);
|
||||
if (operation == NULL)
|
||||
goto error;
|
||||
operation_len = strlen(operation_cstr); /* XXX */
|
||||
|
||||
/* reset description and rowcount */
|
||||
Py_DECREF(self->description);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue