[issue27243] __aiter__ should return async iterator instead of awaitable

Martin Panter report at bugs.python.org
Fri Jun 10 01:42:25 EDT 2016


Martin Panter added the comment:

Test suite emits a new warning, and fails under python -Werror:

======================================================================
ERROR: test_readline (test.test_asyncio.test_pep492.StreamReaderTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/media/disk/home/proj/python/cpython/Lib/test/test_asyncio/test_pep492.py", line 89, in test_readline
    data = self.loop.run_until_complete(reader())
  File "/media/disk/home/proj/python/cpython/Lib/asyncio/base_events.py", line 387, in run_until_complete
    return future.result()
  File "/media/disk/home/proj/python/cpython/Lib/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/media/disk/home/proj/python/cpython/Lib/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/media/disk/home/proj/python/cpython/Lib/test/test_asyncio/test_pep492.py", line 85, in reader
    async for line in stream:
PendingDeprecationWarning: 'StreamReader' implements legacy __aiter__ protocol; __aiter__ should return an asynchronous iterator, not awaitable

----------
nosy: +martin.panter
status: closed -> open

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


More information about the Python-bugs-list mailing list