Issue 25966: Bug in asyncio.corotuines._format_coroutine (original) (raw)

Issue25966

Created on 2015-12-28 16:58 by Brett Rosen, last changed 2022-04-11 14:58 by admin. 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: 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>
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 (https://github.com/python/asyncio/commit/0c3e6ec0340f45d5f6989391358d44b8e974858e). 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.
History
Date User Action Args
2022-04-11 14:58:25 admin set github: 70154
2016-07-25 01:45:10 berker.peksag set status: open -> closedtype: behaviorversions: + Python 3.5, Python 3.6nosy: + berker.peksagmessages: + stage: resolved
2016-01-05 23:57:50 gvanrossum set assignee: gvanrossumresolution: fixed
2016-01-05 23:57:36 gvanrossum set messages: +
2015-12-28 16:58:36 Brett Rosen create