[issue22114] You cannot call communicate() safely after receiving EAGAIN
STINNER Victor
report at bugs.python.org
Thu Jul 31 17:19:10 CEST 2014
STINNER Victor added the comment:
Instead of just catching EAGAIN, you can catch BlockingIOError. In Python 2.7, it means catching: (EAGAIN, EALREADY, EINPROGRESS, EWOULDBLOCK) errors.
I made a similar change in asyncore recently:
---
changeset: 91833:d422062d7d36
branch: 2.7
parent: 91830:841cdb6145e9
user: Victor Stinner <victor.stinner at gmail.com>
date: Thu Jul 24 19:15:00 2014 +0200
files: Doc/library/asyncore.rst Lib/asynchat.py Lib/test/test_asynchat.py Misc/NEWS
description:
Issue #16133: The asynchat.async_chat.handle_read() method now ignores
socket.error() exceptions with blocking I/O errors: EAGAIN, EALREADY,
EINPROGRESS, or EWOULDBLOCK. Initial patch written by Xavier de Gaye.
---
This issue is another reason to not use eventlet with monkey-patching :-) It's time to switch to asyncio (trollius for Python 2)!
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22114>
_______________________________________
More information about the Python-bugs-list
mailing list