Title: Bug in asyncio.corotuines._format_coroutine
Type: behavior Stage: resolved
Components: asyncio Versions: Python 3.6, Python 3.4, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: Brett Rosen, berker.peksag, gvanrossum, vstinner, yselivanov
Priority: normal Keywords:

Created on 2015-12-28 16:58 by Brett Rosen, last changed 2016-07-25 01:45 by berker.peksag. This issue is now closed.

Messages (3)
msg257119 - (view) Author: Brett Rosen (Brett Rosen) * Date: 2015-12-28 16:58
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:

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

This it only gets back None.

> /usr/local/lib/python3.4/asyncio/
-> if _PY34:
(Pdb) func
<cyfunction ProgressTracker._do_report at 0x7fdd2fc46498>
msg257565 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2016-01-05 23:57
Thanks! I've fixed this in the git repo now ( It will be merged into the CPython repo at the next opportunity (before 3.5.2).
msg271202 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-07-25 01:45
Merged in f4fe55dd5659.
Date User Action Args
2016-07-25 01:45:10berker.peksagsetstatus: open -> closed

type: behavior
versions: + Python 3.5, Python 3.6
nosy: + berker.peksag

messages: + msg271202
stage: resolved
2016-01-05 23:57:50gvanrossumsetassignee: gvanrossum
resolution: fixed
2016-01-05 23:57:36gvanrossumsetmessages: + msg257565
2015-12-28 16:58:36Brett Rosencreate