jahschwa / sibyl

a python chatbot with a focus on XBMC
GNU General Public License v3.0
7 stars 6 forks source link

socket: incorrect unicode handling #89

Open jahschwa opened 3 years ago

jahschwa commented 3 years ago

Attempted to send non-ascii back to the client:

Exception in thread Thread-10:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "protocols/sibyl_socket.py", line 173, in run
    self.send_msg(self.ipc['sq'].get())
  File "protocols/sibyl_socket.py", line 252, in send_msg
    sent += self.socket.send(msg[sent:])
  File "/usr/lib/python2.7/ssl.py", line 707, in send
    v = self._sslobj.write(data)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u300c' in position 55: ordinal not in range(128)