Re: [Python-Dev] ParseTuple question

2009-01-05 Thread Kristján Valur Jónsson
Funny, I was just looking at this code. Anyway, whenever I need Unicode stuff as an argument, I use this idiom: PyObject *uO; PyObject *uU; Py_UNICODE *u; If (!PyArg_ParseTuple(args, "O", &uO)) return 0; uU = PyUnicode_FromObject(uO); if (!uU) return 0; u = PyUnicode_AS_UNICODE(uU); There is no au

Re: [Python-Dev] ParseTuple question

2009-01-04 Thread Mark Hammond
On 4/01/2009 9:29 PM, Ulrich Eckhardt wrote: If I'm still misunderstanding, can you be more specific about the exact problem (ie, the exact function you are referring to, and how you intend calling it)? trunk/_fileio.c/fileio_init() Let's leave aside that you can also pass a filedescriptor, th

Re: [Python-Dev] ParseTuple question

2009-01-04 Thread Ulrich Eckhardt
[sorry, dropped one pair of mails off the list, hence also the overquoting] On Sunday 04 January 2009 01:07:08 Mark Hammond wrote: > > > On 'normal' windows you generally would need to use > > > WideCharToMultiByte() to get a 'char *' version of your wchar > > > string but I expect you already kno

Re: [Python-Dev] ParseTuple question

2009-01-03 Thread Mark Hammond
On 2/01/2009 10:32 PM, Ulrich Eckhardt wrote: Hi! I'm looking at NullImporter_init in import.c and especially at the call to PyArg_ParseTuple there. What I'm wondering is what that call will do when I call the function with a Unicode object. Will it convert the Unicode to a char string first, wi