jasonrbriggs / stomp.py

“stomp.py” is a Python client library for accessing messaging servers (such as ActiveMQ or RabbitMQ) using the STOMP protocol (versions 1.0, 1.1 and 1.2). It can also be run as a standalone, command-line client for testing.
Apache License 2.0
491 stars 167 forks source link

fix: correct WSTransport.receive output #422

Closed bernardcooke53 closed 1 year ago

bernardcooke53 commented 1 year ago

Hi there!

I was trying this out and eventually found this bug - I get an AttributeError: 'bytes' object has no attribute 'encode'. I think this is because self.socket.recv() returns either bytes or str, so this PR just handles the case where a string is returned and encodes to bytes - it seems like that's how you wanted this function to behave.

Let me know if I've missed anything - thanks!