libftdi Archives

Subject: Re: RE: ftdi.write_data doesn’t work with some python3 unicode strings

From: "Chris Brackert" <cbrackert@xxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: libftdi@xxxxxxxxxxxxxxxxxxxxxxx, "Michel Zou" <xantares09@xxxxxxxxxxx>
Date: Thu, 05 Nov 2015 11:51:55 -0800 (PST)
After closer inspection, I can confirm that I see that warning too. It did not appear to affect functionality.


On Thu, Nov 5, 2015 at 8:57 AM, Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx> wrote:

On Thursday, 5. November 2015 15:13:52 Michel Zou wrote:
> inline char * str2charp_size(PyObject* pyObj, int * size)
> {
> char * v_ = 0;
> #if PY_MAJOR_VERSION >= 3
> PyBytes_AsStringAndSize(pyObj, &v_, (Py_ssize_t*)size);
> #else
> PyString_AsStringAndSize(pyObj, &v_, (Py_ssize_t*)size);
> #endif
> return v_;
> }

thanks, looking good! Patch committed with the above change.

Cheers,
Thomas


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx




libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


Current Thread