stompest icon indicating copy to clipboard operation
stompest copied to clipboard

StompFrame and StompHeartBeat __str__ method returns bytes in Python 3

Open larserikh opened this issue 6 years ago • 0 comments

The __str__ method must return a string in Python 3 but for StompFrame and StompHeartBeat it returns bytes. For example:

from stompest.protocol import StompFrame, StompSpec frame = StompFrame(StompSpec.SEND, rawHeaders=[('foo', 'bar1'), ('foo', 'bar2')]) bytes(frame) b'SEND\nfoo:bar1\nfoo:bar2\n\n\x00' str(frame) Traceback (most recent call last): File "", line 1, in TypeError: str returned non-string (type bytes)

Maybe __str__ should just call info()?

larserikh avatar Nov 14 '18 05:11 larserikh