I tried all three ways you guys listed nothing seems to convert the string to bytes.
It may have to do with the makeDeviceName function, but I can't find where that is defined. Any thoughts?? Here is the whole block of code: if type(port) in (str, bytes): #strings are taken directly Originally: if type(port) in [type(''), type(u'')] self.portstr = port else: self.portstr = self.makeDeviceName(port) On Feb 25, 8:47 am, Christian Heimes <li...@cheimes.de> wrote: > 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 -- http://mail.python.org/mailman/listinfo/python-list