[issue21878] wsgi.simple_server's wsgi.input read/readline waits forever in certain circumstances

tzickel report at bugs.python.org
Fri Feb 19 13:58:06 EST 2016


tzickel added the comment:

Just encountered this issue as well.

It's not related to newlines, but to not supporting HTTP or persistent connections (the wsgi.input is the socket's I/O directly, and if the client serves a persistent connection, then the .read() will block forever).

A simple solution is to use a saner wsgi server (gevent works nicely).
Here is their implmentation of the socket I/O wrapper class (Input), and it's read/readlines functions:
https://github.com/gevent/gevent/blob/a65501a1270c1763e9de336a9c3cf52081223ff6/gevent/pywsgi.py#L303

----------
nosy: +tzickel

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21878>
_______________________________________


More information about the Python-bugs-list mailing list