Vincent Michel

Results 75 comments of Vincent Michel

@gvanrossum But doesn't it make sense for a `KeyboardInterrupt` to bubble up to `loop.run_forever` and stop the loop regardless of where the exception has been raised? I'm thinking about how...

@gvanrossum I like @haypo's idea of [setting a handler for SIGINT](https://github.com/python/asyncio/pull/305#issuecomment-168486131). A keyboard interrupt is an asynchronous event, and it makes a lot of sense to let the event loop...

I crafted another example to demonstrate that [some programs might get non-interruptible after PR #305](https://gist.github.com/vxgmichel/9132ecd7f78efc30ef0180bc79b67624). In this example, the background task is most likely to catch and ignore the first...

A similar issue has been reported (#390), and the hanging problem has been fixed in PR #391. However, you still need to attach the event loop to the child watcher...

Shouldn't it be fixed in `signalmodule.c` instead? (see my [comment](https://github.com/python/asyncio/issues/396#issuecomment-237863433) in PR #396)

@1st1 I tried to reproduce the bug with python 3.5 and python 3.6 (built from the latest sources) with your test for `asyncio` and this one for `signal`: ``` import...

I implemented something similar as part of [this project](https://github.com/vxgmichel/apython). It provides the following coroutines: - `get_standard_streams(*, use_stderr=False, loop=None)`: return two streams corresponding to `stdin` and `stdout` (or `stderr`) - `ainput(prompt=None,...

@socketpair There are a few differences between the example in your link and the way I wrote it: - I use `sys.stdout` instead of `os.fdopen(0, 'wb')` (I'm not sure what...

+1, definitely! About `asyncio.forever()`, wouldn't it be simpler to have a wrapper around `loop.add_signal_handler(SIGINT, ...)`? For instance: ``` python async def wait_for_interrupt(): loop = asyncio.get_event_loop() future = loop.create_future() loop.add_signal_handler(signal.SIGINT, future.set_result,...

A few comments about `asyncio.run()`: - Isn't restricting `asyncio.run()` to the main thread a bit extreme? I guess it might help avoiding some issues though, e.g subprocess handling on unix...