invisibleroads / socketIO-client

A socket.io client library for Python
http://pypi.python.org/pypi/socketIO-client
MIT License
447 stars 205 forks source link

unhandled network error #134

Open iddq opened 7 years ago

iddq commented 7 years ago
Traceback (most recent call last):
  File "history.py", line 66, in <module>
    socketIO.wait(seconds=1)
  File "/usr/local/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 254, in wait
    self._process_packets()
  File "/usr/local/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 279, in _process_packets
    for engineIO_packet in self._transport.recv_packet():
  File "/usr/local/lib/python2.7/dist-packages/socketIO_client/transports.py", line 156, in recv_packet
    packet_text)
  File "/usr/local/lib/python2.7/dist-packages/socketIO_client/parsers.py", line 96, in parse_packet_text
    packet_type = int(get_character(packet_text, 0))
  File "/usr/local/lib/python2.7/dist-packages/socketIO_client/symmetries.py", line 26, in get_character
    return chr(get_byte(x, index))
  File "/usr/local/lib/python2.7/dist-packages/socketIO_client/symmetries.py", line 30, in get_byte
    return six.indexbytes(x, index)
  File "/usr/lib/python2.7/dist-packages/six.py", line 607, in indexbytes
    return ord(buf[i])
IndexError: string index out of range
invisibleroads commented 7 years ago

Hmm, I would need more context here if available.

If this happens regularly and other people are getting corrupted packets, then maybe we can catch the IndexError and ignore it to drop corrupted packets.