Convert PySerial to python 3.0

Christian Heimes lists at cheimes.de
Wed Feb 25 08:47:03 EST 2009


Seth wrote:
> I implemented "if isinstance(port, str): " that seems to work for now.
> 
> Currently I am running into:
> 
> err, n = win32file.WriteFile(self.hComPort, data,
> self._overlappedWrite)
> TypeError: expected an object with a buffer interface

Unicode objects (in Py3k: str) don't implement the buffer interface. You
have to apply a bytes or bytearray instance.

Christian




More information about the Python-list mailing list