Re: Character strings / Python 3.0 C API

2009-04-08 Thread rch . astra
Thank you very much for your help Martin, now I got it. Cheers, RC On 9 abr, 00:05, "Martin v. Löwis" wrote: > > The issue is that all PyUnicode* functions are returning PyObjects. > > PyString_AsString return value was char*. Is there any real equivalent > > of this function? > > Ah, right. Py

Re: Character strings / Python 3.0 C API

2009-04-08 Thread rch . astra
Sorry but it did not help... I tried this: PyObject* key = PyList_GetItem(moduleKeys,idx); char* theKeyName = PyUnicode_AsUTF8String( key ); And this, just in case: PyObject* key = PyList_GetItem(moduleKeys,idx); char* theKeyName = PyUnicode_AsUTF8String( PyObject

Character strings / Python 3.0 C API

2009-04-08 Thread rch . astra
Hi everybody, I'm doing some experiments with the python 3.0 C API, and I'm having some problems for obtaining character strings. In python 2.X APIs, a function called PyString_AsString was available. This function provided a C string (char*) given a PyObject. But, in python 3.0 API there is no su