PlaidWeb/Pushl

TypeError: Passing coroutines is forbidden, use tasks explicitly.

Closed this issue · 2 comments

Running from commit a13a2e7, installed with pipx and without system-site-packages, I get the following errror:

$ pushl -vc "${XDG_CACHE_HOME-$HOME/.cache}/pushl" -e "https://seirdy.one/notes/2023/01/04/against-chasing-growth/"
Traceback (most recent call last):
  File "/path/to/pipx/bin/pushl", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/path/to/pipx/venvs/pushl/lib64/python3.11/site-packages/pushl/__main__.py", line 128, in main
    loop.run_until_complete(_run(args))
  File "/usr/lib64/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/path/to/pipx/venvs/pushl/lib64/python3.11/site-packages/pushl/__main__.py", line 163, in _run
    _, timed_out = await asyncio.wait(tasks, timeout=args.max_time)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/asyncio/tasks.py", line 415, in wait
    raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
sys:1: RuntimeWarning: coroutine 'Pushl.process_entry' was never awaited

System info: Fedora 37, python 3.11.1.

This looks like a new behavior (or at least enforcement) in Python 3.11. This will probably need some refactoring.

Okay, the change was pretty straightforward, and is tested working on 3.8. I'm installing Python 3.11 to verify the fix.