Title: handle_close called twice in poll2
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.5, Python 3.4
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, giampaolo.rodola, josiahcarlson, neologix, stutzbach, xdegaye
Priority: normal Keywords: patch

Created on 2011-11-08 17:32 by xdegaye, last changed 2014-06-21 00:27 by BreamoreBoy.

File name Uploaded Description Edit
handle_close.diff xdegaye, 2011-11-08 17:32 review
Messages (2)
msg147311 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2011-11-08 17:32
When use_poll is True, test_handle_close in invokes
twice the handle_close() method.

The attached patch:

    modifies test_handle_close so that it fails when handle_close() is
    called more than once

    includes a fix that makes readwrite() behave like poll(): check
    that the dispatcher instance is still in the socket map, before
    calling the handle_xxx methods
msg221136 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-21 00:27
To me the patched code in readwrite seems cut and paste.  Could it be written something like this?

have_fileno = not map or obj._fileno in map
if have_fileno and flags & select.POLLIN:
if have_fileno and flags & select.POLLOUT:
if have_fileno and flags & select.POLLPRI:
if (have_fileno and flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
Date User Action Args
2014-06-21 00:27:38BreamoreBoysetnosy: + BreamoreBoy

messages: + msg221136
versions: + Python 3.4, Python 3.5, - Python 3.3
2011-11-08 17:32:12xdegayecreate