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 Alisue Lambda
Recipients Alisue Lambda, asvetlov, yselivanov
Date 2018-08-07.09:24:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533633880.33.0.56676864532.issue33350@psf.upfronthosting.co.za>
In-reply-to
Content
I use the following patch to fix the behavior in Windows.


```
import sys

if sys.platform != 'win32':
    def patch():
        pass
else:
    def patch():
        """Patch selectors.SelectSelector to fix WinError 10038 in Windows

        Ref: https://bugs.python.org/issue33350
        """

        import select
        from selectors import SelectSelector

        def _select(self, r, w, _, timeout=None):
            try:
                r, w, x = select.select(r, w, w, timeout)
            except OSError as e:
                if hasattr(e, 'winerror') and e.winerror == 10038:
                    # descriptors may already be closed
                    return [], [], []
                raise
            else:
                return r, w + x, []

        SelectSelector._select = _select
```
History
Date User Action Args
2018-08-07 09:24:40Alisue Lambdasetrecipients: + Alisue Lambda, asvetlov, yselivanov
2018-08-07 09:24:40Alisue Lambdasetmessageid: <1533633880.33.0.56676864532.issue33350@psf.upfronthosting.co.za>
2018-08-07 09:24:40Alisue Lambdalinkissue33350 messages
2018-08-07 09:24:40Alisue Lambdacreate