A
abhi
Hi,
I am facing a problem using PyArg_ParseTuple() in my C-API
extension. Here is a small repro of the function:
static PyObject *parsetuple_test(PyObject *self, PyObject *args)
{
SQLUSMALLINT param_no = 0;
PyObject *py_obj = NULL;
if (!PyArg_ParseTuple(args, "Oi", &py_obj, ¶m_no)){
return NULL;
}
printf("%d\n", param_no);
return NULL;
}
This function works fine and prints the correct value passed
(param_no) when I test it on Linux or Windows. However, it always
prints 0 (initial value defined in function) when I run it on AIX.
I think the problem is with "Oi" argument, if I replace that with "OO"
and specifically convert it integer/sqlsmallint. It works fine on AIX,
but I want to use "i" and not "O".
Any ideas on what is the reason behind the problem and how to fix
this?
Thanks,
Abhigyan
I am facing a problem using PyArg_ParseTuple() in my C-API
extension. Here is a small repro of the function:
static PyObject *parsetuple_test(PyObject *self, PyObject *args)
{
SQLUSMALLINT param_no = 0;
PyObject *py_obj = NULL;
if (!PyArg_ParseTuple(args, "Oi", &py_obj, ¶m_no)){
return NULL;
}
printf("%d\n", param_no);
return NULL;
}
This function works fine and prints the correct value passed
(param_no) when I test it on Linux or Windows. However, it always
prints 0 (initial value defined in function) when I run it on AIX.
I think the problem is with "Oi" argument, if I replace that with "OO"
and specifically convert it integer/sqlsmallint. It works fine on AIX,
but I want to use "i" and not "O".
Any ideas on what is the reason behind the problem and how to fix
this?
Thanks,
Abhigyan