[issue33786] @asynccontextmanager doesn't work well with async generators

2020-08-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thank you very much, Ned!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2020-08-14 Thread Ned Deily


Ned Deily  added the comment:

I'm still not sure exactly what happened here but it looks like the backport to 
3.7 (PR 7506) from the  original fix in master (pre-3.8) (PR 7467) failed but 
the backport to 3.6 (PR 7507) succeeded.  And then it was backported a second 
time to 3.6 (PR 7514) which also succeeded but had no effect since there were 
no intervening changes to those files. So it may be that PR 7514 was intended 
to be for 3.7 instead of 3.6.  In any case, a fresh backport from master to 3.7 
(PR 21878) succeeded and tests pass, so into 3.7 it goes for release in 3.7.9.

--
priority: release blocker -> 
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2020-08-14 Thread Ned Deily


Ned Deily  added the comment:


New changeset cf79cbf4479e395bf7c4df2907f5a444639b4f6f by Miss Islington (bot) 
in branch '3.7':
bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() 
(GH-7467) (GH-21878)
https://github.com/python/cpython/commit/cf79cbf4479e395bf7c4df2907f5a444639b4f6f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2020-08-14 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +21003
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/21878

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2020-08-12 Thread Ned Deily


Ned Deily  added the comment:

Indeed, the backport to 3.7 slipped through the cracks somehow; we should fix 
that. Thanks for bringing this up!

--
resolution: fixed -> 
stage: resolved -> backport needed
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2020-08-11 Thread Joshua Oreman


Joshua Oreman  added the comment:

This doesn't appear to have been backported to 3.7, even though it's in 3.6.6 
and 3.8.0a0.

--
nosy: +Joshua Oreman, lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-07 Thread Yury Selivanov


Change by Yury Selivanov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-07 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset b0bb9a81f60ed248a44b4c8008c0549c3e9e741d by Yury Selivanov in 
branch '3.6':
bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() 
(GH-7467) (#7514)
https://github.com/python/cpython/commit/b0bb9a81f60ed248a44b4c8008c0549c3e9e741d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-07 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +7140

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-07 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 8de73d5a6914cfe55c23b0ad829cd2ba8954bc2e by Yury Selivanov in 
branch '3.6':
bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() 
(GH-7467) (GH-7507)
https://github.com/python/cpython/commit/8de73d5a6914cfe55c23b0ad829cd2ba8954bc2e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-07 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +7135

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7134

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-07 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 52698c7ad9eae9feb35839fde17a7d1da8036a9b by Yury Selivanov in 
branch 'master':
bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() 
(GH-7467)
https://github.com/python/cpython/commit/52698c7ad9eae9feb35839fde17a7d1da8036a9b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-07 Thread Ned Deily


Ned Deily  added the comment:

> Would be nice to fix this in 3.7.0

Please do!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-06 Thread Yury Selivanov


Yury Selivanov  added the comment:

Would be nice to fix this in 3.7.0

--
components: +Interpreter Core -asyncio
nosy: +ned.deily
priority: normal -> release blocker
type:  -> behavior
versions: +Python 3.6, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-06 Thread Yury Selivanov


Change by Yury Selivanov :


--
keywords: +patch
pull_requests: +7089
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-06 Thread Valentin Lavrinenko


Valentin Lavrinenko  added the comment:

Sorry, `async with ctx()` in main() is not needed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33786] @asynccontextmanager doesn't work well with async generators

2018-06-06 Thread Valentin Lavrinenko


New submission from Valentin Lavrinenko :

```
@asynccontextmanager
async def ctx():
yield


async def gen():
async with ctx():
yield 'hello'
yield 'world'


async def main():
async with ctx():
async for value in gen():
print(value)
raise RuntimeError()
```

Running main() leads to `RuntimeError: generator didn't stop after throw()`. 
This happens because async gernerator's `.athrow()` method doesn't re-throw 
`GeneratorExit` exception; probably, this is wrong.

--
components: asyncio
messages: 318853
nosy: Valentin Lavrinenko, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: @asynccontextmanager doesn't work well with async generators
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com