Re: where is the PyString_AsString in Python 3.0?

2009-03-08 Thread Stefan Behnel
BigHand wrote: I know that there is no PyString_AsString in Python3.0, could you guys give me instruction about how can I do with the following ? PyObject *exc_type = NULL, *exc_value = NULL, *exc_tb = NULL; PyErr_Fetch(exc_type, exc_value, exc_tb); how do I transfer the exc_type in a

Re: where is the PyString_AsString in Python 3.0?

2009-03-08 Thread Stefan Behnel
BigHand wrote: Finally I got the results now. This did take me 10 hours to solve this. the docs of 3.0.. You will have to get used to Unicode. The code you used against the C-API mimics almost exactly the steps you'd use at the Python level. Stefan --

where is the PyString_AsString in Python 3.0?

2009-03-06 Thread BigHand
Guys: I know that there is no PyString_AsString in Python3.0, could you guys give me instruction about how can I do with the following ? PyObject *exc_type = NULL, *exc_value = NULL, *exc_tb = NULL; PyErr_Fetch(exc_type, exc_value, exc_tb); how do I transfer the exc_type in a char* ? thanks in

Re: where is the PyString_AsString in Python 3.0?

2009-03-06 Thread Benjamin Peterson
BigHand heweiwei at gmail.com writes: Guys: I know that there is no PyString_AsString in Python3.0, could you guys give me instruction about how can I do with the following ? There is no PyString_AsString. Everything string is unicode now. (PyUnicode API) --

Re: where is the PyString_AsString in Python 3.0?

2009-03-06 Thread BigHand
On 3月6日, 下午8时50分, Benjamin Peterson benja...@python.org wrote: BigHand heweiwei at gmail.com writes: Guys: I know that there is no PyString_AsString in Python3.0, could you guys give me instruction about how can I do with the following ? There is no PyString_AsString. Everything

Re: where is the PyString_AsString in Python 3.0?

2009-03-06 Thread Benjamin Peterson
BigHand heweiwei at gmail.com writes: There is no PyString_AsString. Everything string is unicode now. (PyUnicode API) hello,Ben, could you give me an example? I almost know the PyUnicode API,but the docs of 3.0 is too brief for me. PyString_FromString - PyUnicode_FromString

Re: where is the PyString_AsString in Python 3.0?

2009-03-06 Thread BigHand
On Mar 7, 3:50 am, Benjamin Peterson benja...@python.org wrote: BigHand heweiwei at gmail.com writes: There is no PyString_AsString. Everything string is unicode now. (PyUnicode API) hello,Ben, could you give me an example? I almost know the PyUnicode API,but the docs of 3.0 is too

Re: where is the PyString_AsString in Python 3.0?

2009-03-06 Thread BigHand
On Mar 7, 9:34 am, BigHand hewei...@gmail.com wrote: On Mar 7, 3:50 am, Benjamin Peterson benja...@python.org wrote: BigHand heweiwei at gmail.com writes: There is no PyString_AsString. Everything string is unicode now. (PyUnicode API) hello,Ben, could you give me an example? I

Re: where is the PyString_AsString in Python 3.0?

2009-03-06 Thread Benjamin Peterson
BigHand heweiwei at gmail.com writes: Finally I got the results now. This did take me 10 hours to solve this. the docs of 3.0.. I hope this could help someone else: const char *strExcType = PyBytes_AS_STRING(pyStr); Py_XDECREF(str_exc_type); Py_XDECREF(pyStr); You can't Py_DECREF()