I just tried running the Tornado test suite with this backported package and it mostly works. There are two issues:
* Tornado uses hasattr(ssl, 'SSLContext') to determine whether or not it can use the APIs introduced in Python 3.2; the incomplete version of SSLContext patched in by this package confuses it. I had to replace the hasattr calls with explicit sys.version_info checks. * One corner case is handled differently than in other implementations (TestIOStreamSSL.test_inline_read_error). I haven't traced it all the way through (this test is deliberately doing weird things to deterministically trigger an error at a particular spot). The failure may be kqueue-specific (it has to do with the fact that if you close an fd without the event loop's knowledge with os.close(fd), subsequently unregistering that fd will fail). -Ben On Fri, Dec 20, 2013 at 3:58 AM, Victor Stinner <[email protected]>wrote: > 2013/12/19 Marc Schlaich <[email protected]>: > > - selectors module would be better in the package (as it is in tulip: > > https://code.google.com/p/tulip/source/browse/#hg%2Fasyncio) > > I discussed with the author of the selector module, Charles-François > Natali, to ask him if he would like to maintain a backport on PyPI. > He's not interested. I can maintain the backport, but we agreed that > using selectors alone is not really interesting. The selectors is > useful when used with asyncio. > > > - patching the exceptions via builtins does not work on OSX, that's the > > reason for various errors in test_events, e.g.: > > > > kev_list = self._kqueue.control(None, max_ev, timeout) > > > > OSError: [Errno 4] Interrupted system call > > I only tried tulip_py2 on Linux. You may retry with this commit: > > changeset: 77:383ef5a06958 > tag: tip > user: Victor Stinner <[email protected]> > date: Fri Dec 20 09:37:37 2013 +0100 > files: selectors.py > description: > Fix kqueue selector: use wrap_error() to catch InterruptedError > > > - test_subprocess_close_client_stream hangs forever. Any idea? > > No idea. You may try to setup the logging module to get more information: > > import logging; logging.basicConfig() > > > The rest of test_events is fine after replacing InterruptedError with > OSError. > > Right now, I prefer to limit differences with Tulip and so I used an > hack in asyncio.backport to get InterruptedError. If the failures are > not related to kqueue, is there other places where wrap_error() is > missing? > > Later, I may drop these hacks and catch OSError and check the errno > attribute instead. > > Victor >
