New submission from Vladimir Rutsky:

Return of @asyncio.coroutine-wrapped coroutine object from 
@asyncio.coroutine-wrapped coroutine fails if asyncio debug is enabled.

Consider following example:

@asyncio.coroutine
def outer_coro():
    @asyncio.coroutine
    def inner_coro():
        return 1

    return g()

result = loop.run_until_complete(outer_coro())

If debug is disabled result will be 1, if debug is enabled, result will be 
CoroWrapper object.

This issue is discussed on asyncio mailing list: 
https://groups.google.com/forum/?fromgroups#!topic/python-tulip/YFfFxftxxDc

Complete example to reproduce this problem is here: 
https://gist.github.com/rutsky/c72be2edeb1c8256d680

Attaching patch for Python 3.4 branch that fixes this issue and add test for 
this bug.

This issue is not reproduced in Python 3.5, because CoroWrapper is awaitable in 
Python 3.5 (and in Python 3.4 CoroWrapper is not future or generator).

----------
components: asyncio
files: fix_return_of_coro_from_coro.diff
keywords: patch
messages: 254799
nosy: gvanrossum, haypo, vrutsky, yselivanov
priority: normal
severity: normal
status: open
title: Return of asyncio.coroutine from asyncio.coroutine don't work in with 
enabled debug
versions: Python 3.4
Added file: http://bugs.python.org/file41063/fix_return_of_coro_from_coro.diff

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

Reply via email to