[PyQt] Python3 question

Phil Thompson phil at riverbankcomputing.com
Sun Mar 22 17:56:53 GMT 2009


On Sat, 21 Mar 2009 19:39:41 +0100, Detlev Offenbach
<detlev at die-offenbachs.de> wrote:
> Hi,
> 
> I am in the process of writing a Python3 compatible debugger backend for 
> eric4. However, I am having a problem I cannot solve to to being not very

> familiar with the new Python3 stuff.
> 
> Eric4 uses file like objects to buffer the socket connection to the debug

> server (= the IDE). That is implemented in AsyncFile.py. When I use this
> file 
> with Python3, an exception is raised.
> 
> TypeError('expected an object with the buffer interface',)
> 
> What does this mean and what do I have to do to fix it?
> 
> Thanks for any help.

You are probably passing a string (ie. a unicode object) as an argument to
a method of a bytes object. For example...

b = b"foo"
b.startswith("f")

...but this is Ok...

b.startswith(b"f")

Phil


More information about the PyQt mailing list