[issue26221] awaiting asyncio.Future swallows StopIteration

2016-03-02 Thread Yury Selivanov
Yury Selivanov added the comment: Merged. -- resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker ___ __

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-03-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset ef5265bc07bb by Yury Selivanov in branch '3.5': asyncio: Prevent StopIteration from being thrown into a Future https://hg.python.org/cpython/rev/ef5265bc07bb New changeset 5e2f7e51af51 by Yury Selivanov in branch 'default': Merge 3.5 (issue #26221)

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-21 Thread Chris Angelico
Chris Angelico added the comment: Opened https://github.com/python/asyncio/pull/322 -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-21 Thread Guido van Rossum
Guido van Rossum added the comment: Would you mind reworking this as a PR for github.com/python/asyncio ? That's still considered "upstream" for asyncio. --Guido On Sun, Feb 21, 2016 at 8:17 AM, Chris Angelico wrote: > > Chris Angelico added the comment: > > Wording changed, and a simple test

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-21 Thread Chris Angelico
Chris Angelico added the comment: Wording changed, and a simple test added. I'm currently seeing failures in test_site, but that probably means I've messed something up on my system. -- Added file: http://bugs.python.org/file41986/no_stop_iter.patch

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-21 Thread Guido van Rossum
Guido van Rossum added the comment: S.G.T.M. On Sunday, February 21, 2016, Chris Angelico wrote: > > Chris Angelico added the comment: > > How about "StopException interacts badly with generators and cannot be > raised into a Future"? > > -- > > ___

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-21 Thread Chris Angelico
Chris Angelico added the comment: How about "StopException interacts badly with generators and cannot be raised into a Future"? -- ___ Python tracker ___ ___

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Guido van Rossum
Guido van Rossum added the comment: I think TypeError is fine. I would make the message a bit longer to explain carefully what's the matter. -- ___ Python tracker ___ ___

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Chris Angelico
Chris Angelico added the comment: POC patch, no tests. Is TypeError right? Should it be ValueError, since the notional type is "Exception"? -- keywords: +patch Added file: http://bugs.python.org/file41980/no_stop_iter.patch ___ Python tracker

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Guido van Rossum
Guido van Rossum added the comment: OK, since eventually there won't be a way to inject StopIteration into a Future anyway (it'll always raise RuntimeError once PEP 479 is the default behavior) we should just reject this in set_exception(). -- ___ Pyt

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Chris Angelico
Chris Angelico added the comment: Ultimately, it's the exact same thing that PEP 479 is meant to deal with - raising StopIteration is functionally identical to returning. I don't use asyncio enough to be certain, but I'm not aware of any good reason to inject a StopIteration into it; maybe an

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Guido van Rossum
Guido van Rossum added the comment: Chris, can you help out here? I still don't understand the issue here. Since "from __future__ import generator_stop" only works in 3.5+ it would not work in Python 3.3/3.4 (supported by upstream asyncio with literally the same source code currently). If ther

[issue26221] awaiting asyncio.Future swallows StopIteration

2016-02-20 Thread Ian Kelly
Ian Kelly added the comment: Chris Angelico suggested on python-list that another possibly useful thing to do would be to add a "from __future__ import generator_stop" to asyncio/futures.py. This would at least have the effect of causing "await future" to raise a RuntimeError instead of silent