[issue39116] StreamReader.readexactly() raises GeneratorExit on ProactorEventLoop

twisteroid ambassador report at bugs.python.org
Wed Oct 21 07:03:28 EDT 2020


twisteroid ambassador <twisteroid.ambassador at gmail.com> added the comment:

Well this is unexpected, the same code running on Linux is throwing GeneratorExit-related mysterious exceptions as well. I'm not sure whether this is the same problem, but this one has a clearer traceback. I will attach the full error log, but the most pertinent part seems to be this:


During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.8/contextlib.py", line 662, in __aexit__
    cb_suppress = await cb(*exc_details)
  File "/usr/lib/python3.8/contextlib.py", line 189, in __aexit__
    await self.gen.athrow(typ, value, traceback)
  File "/opt/prettysocks/prettysocks.py", line 332, in closing_writer
    await writer.wait_closed()
  File "/usr/lib/python3.8/asyncio/streams.py", line 376, in wait_closed
    await self._protocol._get_close_waiter(self)
RuntimeError: cannot reuse already awaited coroutine


closing_writer() is an async context manager that calls close() and await wait_closed() on the given StreamWriter. So it looks like wait_closed() can occasionally reuse a coroutine?

----------
Added file: https://bugs.python.org/file49534/error_log_on_linux_python38.txt

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39116>
_______________________________________


More information about the Python-bugs-list mailing list