_stream_base reproducible IOError

22 views
Skip to first unread message

Ryan Baker

unread,
Oct 25, 2012, 12:25:15 PM10/25/12
to pyweb...@googlegroups.com
At line 112 in '_read' bytes is intended to receive the result from connection.read(length) and in the case of an exception prepend the remote address and raise the exception again. A potential issue can occur in the case that connection.read() fails with an IOError. This can happen when the connection is opened and closed too quickly. I added in a block to catch these exceptions on my local machine:

112         try:                                                                                                                                                                                                                                                                                                           
113             bytes = self._request.connection.read(length)
114         except IOError:
115             bytes = False

I'm sure there's a more elegant way to go about handling this properly, but it can cause a TON of useless exceptions to flood the error logs.

Relevant portion of the traceback:
_stream_base.py", line 112, in _read\n    bytes = self._request.connection.read(length)\nIOError: web_socket_transfer_data raised exception for /leaguechat: Connection read error\n

Takeshi Yoshino

unread,
Oct 30, 2012, 12:17:18 AM10/30/12
to pyweb...@googlegroups.com
Thanks for the report.

We've incorporated your suggestion.

Reply all
Reply to author
Forward
0 new messages