[New-bugs-announce] [issue25966] Bug in asyncio.corotuines._format_coroutine

Brett Rosen report at bugs.python.org
Mon Dec 28 11:58:36 EST 2015


New submission from Brett Rosen:

When running some test cases via py.test and using a coroutine created inside of cythonized code, I get the following:

   def _format_coroutine(coro):
        assert iscoroutine(coro)
        coro_name = getattr(coro, '__qualname__', coro.__name__)
    
        filename = coro.gi_code.co_filename
        if (isinstance(coro, CoroWrapper)
        and not inspect.isgeneratorfunction(coro.func)):
>           filename, lineno = events._get_function_source(coro.func)
E           TypeError: 'NoneType' object is not iterable


This appears to be because this line:

https://github.com/python/asyncio/blob/2a19f9329f4ee710fef7728b316aa4fe1d07dbef/asyncio/coroutines.py#L289

Is expecting to get back two values, but because of:

https://github.com/python/asyncio/blob/master/asyncio/events.py#L35

This it only gets back None.


> /usr/local/lib/python3.4/asyncio/events.py(25)_get_function_source()
-> if _PY34:
(Pdb) func
<cyfunction ProgressTracker._do_report at 0x7fdd2fc46498>

----------
components: asyncio
messages: 257119
nosy: Brett Rosen, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: Bug in  asyncio.corotuines._format_coroutine
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25966>
_______________________________________


More information about the New-bugs-announce mailing list