Skip to content

python3.12 fail to close asyncio.Runner #21

@pbk20191

Description

@pbk20191
Traceback (most recent call last):
  File "C:\Users\pbk\PycharmProjects\pythonProject\foo.py", line 30, in <module>
    asyncio.run(main(), debug=True, loop_factory=winloop.new_event_loop)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1008.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 193, in run
    with Runner(debug=debug, loop_factory=loop_factory) as runner:
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1008.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 62, in __exit__
    self.close()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1008.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 73, in close
    loop.shutdown_default_executor(constants.THREAD_JOIN_TIMEOUT))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: shutdown_default_executor() takes exactly 0 positional arguments (1 given)

winloop.shutdown_default_executor takes 0 argument while asyncio.Runner.close expect to pass argument to the loop.shutdown_default_executor

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions