[Numpy-discussion] Segfault with python 3.2 structured array non-existent field

Pauli Virtanen pav at iki.fi
Tue Mar 15 14:07:00 EDT 2011

Tue, 15 Mar 2011 10:23:35 -0700, Matthew Brett wrote:
> OK - I realize I'm being very lazy here but, do you mean:
>         PyErr_Format(PyExc_ValueError,
>>>                      "field named %s not found.",
>>>                      PyString_AsString(PyObject_Repr(index)));
>> The PyString_AsString is present, as it's mapped on Py3 to
>> PyBytes_AsString by "npy_3kcompat.h".
> Oh - dear - I think I felt a blood vessel pop somewhere in my brain :)

This was an "answer" to your question as I understood it: 
"PyString_AsString is no longer a part of the API on Python 3.x. So how 
come this code can work on Python 3 if it appears here?"


More information about the NumPy-Discussion mailing list