Package: python3-socketio-client Version: 0.6.5-0.1 Severity: normal Dear Maintainer,
When receiving data, the WebsocketTransport class calls six.b on the input packet. In python3, this is implemented as encoding the string into "latin-1". Which immediately raise an exception if the string contains non-latin-1 characters. There's something smelly about the way the packets are parsed. Either we know it's all text, and we can let the websocket class do the decoding by looking at the packet opcode. Or we have byte-level suff to do and we should get the bytes directly from the WebSocket class without letting it decide it. Or, as last alternative encode the string as utf-8 if we're in python3 and got a str object, since the WebSocket class only decode as utf-8. First solution: Remove the call to six.b and just handle the str object instead of bytes. Second solution: Call recv_data() instead of recv() to get packet_text. Third solution: if six.PY3 and isinstance(packet_text, str): packet_text = packet_text.encode("utf-8") Best regards, Celelibi -- System Information: Debian Release: 9.0 APT prefers testing APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'unstable') Architecture: i386 (x86_64) Kernel: Linux 3.10.11 (SMP w/2 CPU cores; PREEMPT) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Init: sysvinit (via /sbin/init) Versions of packages python3-socketio-client depends on: ii python3-requests 2.12.4-1 ii python3-six 1.10.0-3 ii python3-websocket 0.37.0-2 python3-socketio-client recommends no packages. python3-socketio-client suggests no packages. -- no debconf information