Yeah, I think the base implementation of run_until_complete is wrong. I think I didn't have stop() when I coded that.
Could you change it to something that just registers a lambda calling stop() on the Future, and see if that makes your test case behave better? (If so, please add a unit test and submit for code review.)
On Mon, Feb 11, 2013 at 4:21 AM, Saúl Ibarra Corretgé email@example.com wrote:
While analyzing some code I came across the following situation:
- User calls run_until_complete for some Task
- The task itself calls loop.stop() at some point
- run_until_complete raises TimeoutError
Here is a very simple example: https://gist.github.com/saghul/4754117
Something seems a bit off here. While one could argue that stopping the loop while run_until_complete is ongoing, getting a TimeoutError doesn't feel right. I think we should detect that the loop was stopped but the future is not done and raise something like NotCompleted or FutureNotCompleted.
-- Saúl Ibarra Corretgé http://saghul.net/blog | http://about.me/saghul _______________________________________________ Python-ideas mailing list Pythonfirstname.lastname@example.org http://mail.python.org/mailman/listinfo/python-ideas