You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the chat example, and I'm getting some problems in the encoding. Specifically, if I use the letter "á" in a message inside a room, the connection drops.
To reproduce the error, use the example along with
I just start using it, so I don't have so much experience to tackle the error. Nevertheless, I hope the attached log from the socket_io helps.
127.0.0.1 - - [2013-11-04 15:36:33] "Socket.IO message: {u'action': u'start', u'room': 3, u'name': u'test_subject'}"
Traceback (most recent call last):
File "/Users/user1/env/lib/python2.7/site-packages/gevent/greenlet.py", line 390, in run
result = self._run(*self.args, **self.kwargs)
File "/Users/user1/env/lib/python2.7/site-packages/socketio/server.py", line 49, in handle
handler.handle()
File "/Users/user1/env/lib/python2.7/site-packages/gevent/pywsgi.py", line 180, in handle
result = self.handle_one_request()
File "/Users/user1/env/lib/python2.7/site-packages/gevent/pywsgi.py", line 314, in handle_one_request
self.handle_one_response()
File "/Users/user1/env/lib/python2.7/site-packages/socketio/handler.py", line 68, in handle_one_response
jobs = self.transport.connect(session, request_method)
File "/Users/user1/env/lib/python2.7/site-packages/socketio/transports.py", line 101, in connect
return self.handle_post_response(session)
File "/Users/user1/env/lib/python2.7/site-packages/socketio/transports.py", line 67, in handle_post_response
messages = self.decode(data)
File "/Users/user1/env/lib/python2.7/site-packages/socketio/transports.py", line 16, in decode
return self.handler.environ['socketio'].decode(data)
File "/Users/user1/env/lib/python2.7/site-packages/socketio/protocol.py", line 113, in decode
messages.append(json.loads(data[3:size]))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 326, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting object: line 1 column 83 (char 83)
<Greenlet at 0x1027cd5f0: <bound method SocketIOServer.handle of <SocketIOServer at 0x10270e2d0 fileno=3 address=127.0.0.1:9000>>(<socket at 0x10275f450 fileno=[Errno 9] Bad file d, ('127.0.0.1', 57567))> failed with ValueError
The text was updated successfully, but these errors were encountered:
Bad news is that at a glance it appears to be an error in one of the dependencies, either gevent-websocket or gevent-socketio. Now currently django-socketio is tied to very outdated versions of those, so in all likelihood, the bug may have already been fixed in those.
So this issue is more or less dependant on #19 being resolved, at which point this may no longer even be a problem. I'll leave it open for now just in case.
In case anyone is still facing this problem, my workaround on it consisted in converting the socket message to an array of char codes and stringified with JSON. When receiving the message, it is need to parse the message back to the array of code (JSON.parse), and converting it to string again. See helper functions bellow:
I'm using the chat example, and I'm getting some problems in the encoding. Specifically, if I use the letter "á" in a message inside a room, the connection drops.
To reproduce the error, use the example along with
I just start using it, so I don't have so much experience to tackle the error. Nevertheless, I hope the attached log from the socket_io helps.
The text was updated successfully, but these errors were encountered: