From 066750eced13afaabe6bc8eaa99168ef4b11aba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sim=C3=B3=20Albert=20i=20Beltran?= Date: Wed, 13 May 2015 18:17:53 +0200 Subject: [PATCH] fix output of wsdump.py with python3 --- bin/wsdump.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/wsdump.py b/bin/wsdump.py index 6a9d1d8..1333db5 100755 --- a/bin/wsdump.py +++ b/bin/wsdump.py @@ -116,6 +116,8 @@ def main(): while True: opcode, data = recv() msg = None + if six.PY3 and opcode == websocket.ABNF.OPCODE_TEXT and isinstance(data, bytes): + data = str(data, "utf-8") if not args.verbose and opcode in OPCODE_DATA: msg = "< %s" % data elif args.verbose: