Kyle Stanley <aeros...@gmail.com> added the comment:

Thanks for letting us know, janust. I confirmed that `asyncio.TimeoutError` no 
longer works for the code example in 3.8 and that replacing it with 
`concurrent.futures.TimeoutError` works correctly.

Before moving forward with a PR to the docs, I think we should wait for 
feedback from Yury to check if this behavior is intentional for 
`run_coroutine_threadsafe()`, I'll add him to the nosy list.

To me, this seems more like a side effect of `asyncio.TimeoutError` being 
changed to BaseException rather than an intended consequence. The main purpose 
of that change was to ensure that TimeoutError wasn't unintentionally 
suppressed by generic try-except blocks. IMO, it seems rather counter-intuitive 
to have to specify `concurrent.futures.TimeoutError` when using a timeout for 
the future returned by `run_coroutine_threadsafe()`. I'm not certain that it 
can be avoided though, other than by changing it to return an instance of 
asyncio.Future instead of concurrent.futures.Future.

----------
nosy: +aeros, yselivanov

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39027>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to