WebSocket-for-Python icon indicating copy to clipboard operation
WebSocket-for-Python copied to clipboard

Closing message received – too many 's

Open jolaf opened this issue 2 years ago • 0 comments

When debugging is enabled, sometimes the following message appears:

[D 230728 02:14:00 websocket:465] Closing message received (1005) 'b'''

Note too many 's in the message. The reason for this is websocket.py line 465:

logger.debug("Closing message received (%d) '%s'" % (s.closing.code, s.closing.reason))

As s.closing.reason is a bytes object, it gets printed as b'' anyway, so extra 's around it seem unnecessary and either should be removed or s.closing.reason should be appended with .decode() to remove b'' formatting.

The same is true for line 474:

logger.debug("Error message received (%d) '%s'" % (error.code, error.reason))

jolaf avatar Jul 27 '23 23:07 jolaf