This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients neologix, pitrou, pklanke, vstinner, yselivanov
Date 2017-09-26.12:13:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It would help to look how Twisted, eventlet, gevent and others handle "urgent data" and "exceptions". Check if they succeeded to formalize these events.

asyncore uses select() or poll().

asyncore.poll() uses It adds the fd to exceptfds if the fd is in the readfds or writefds, then asyncore calls _exception():

        r = []; w = []; e = []
        for fd, obj in map.items():
            is_r = obj.readable()
            is_w = obj.writable()
            if is_r or is_w:

            r, w, e =, w, e, timeout)
        except select.error, err:


        for fd in e:
            obj = map.get(fd)
            if obj is None:

asyncore.poll2() uses select.poll(). It only uses POLLPRI if the fd is readable but always checks for error condition (POLLERR) (if asyncio waits for read and/or write events):

        for fd, obj in map.items():
            flags = 0
            if obj.readable():
                flags |= select.POLLIN | select.POLLPRI
            # accepting sockets should not be writable
            if obj.writable() and not obj.accepting:
                flags |= select.POLLOUT
            if flags:
                # Only check for exceptions if object was either readable
                # or writable.
                flags |= select.POLLERR | select.POLLHUP | select.POLLNVAL
                pollster.register(fd, flags)
Date User Action Args
2017-09-26 12:13:26vstinnersetrecipients: + vstinner, pitrou, neologix, yselivanov, pklanke
2017-09-26 12:13:26vstinnersetmessageid: <>
2017-09-26 12:13:26vstinnerlinkissue30844 messages
2017-09-26 12:13:26vstinnercreate