Enable PY_SSIZE_T_CLEAN in order to avoid deprecation warning and/or segfault

under Python 3.8.0b1 (https://github.com/oracle/python-cx_Oracle/issues/317).
This commit is contained in:
Anthony Tuininga 2019-06-17 16:17:18 -06:00
parent d8bde9ca54
commit df56c7f17f
3 changed files with 4 additions and 2 deletions

View File

@ -1199,7 +1199,7 @@ static PyObject *cxoConnection_commit(cxoConnection *conn, PyObject *args)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static PyObject *cxoConnection_begin(cxoConnection *conn, PyObject *args) static PyObject *cxoConnection_begin(cxoConnection *conn, PyObject *args)
{ {
uint32_t transactionIdLength, branchIdLength; Py_ssize_t transactionIdLength, branchIdLength;
const char *transactionId, *branchId; const char *transactionId, *branchId;
int formatId, status; int formatId, status;

View File

@ -9,6 +9,8 @@
// Include file for all cx_Oracle source files. // Include file for all cx_Oracle source files.
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#define PY_SSIZE_T_CLEAN 1
#include <Python.h> #include <Python.h>
#include <structmember.h> #include <structmember.h>
#include <time.h> #include <time.h>

View File

@ -332,7 +332,7 @@ static PyObject *cxoSessionPool_acquire(cxoSessionPool *pool, PyObject *args,
"tag", "matchanytag", "shardingkey", "supershardingkey", NULL }; "tag", "matchanytag", "shardingkey", "supershardingkey", NULL };
PyObject *createKeywordArgs, *result, *cclassObj, *purityObj, *tagObj; PyObject *createKeywordArgs, *result, *cclassObj, *purityObj, *tagObj;
PyObject *shardingKeyObj, *superShardingKeyObj; PyObject *shardingKeyObj, *superShardingKeyObj;
unsigned usernameLength, passwordLength; Py_ssize_t usernameLength, passwordLength;
char *username, *password; char *username, *password;
PyObject *matchAnyTagObj; PyObject *matchAnyTagObj;