Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't instantiate abstract class _Interceptor with abstract method __await__ #20

Closed
RockChinQ opened this issue Dec 15, 2024 · 8 comments · Fixed by #25
Closed

Can't instantiate abstract class _Interceptor with abstract method __await__ #20

RockChinQ opened this issue Dec 15, 2024 · 8 comments · Fixed by #25

Comments

@RockChinQ
Copy link

Hello, I've a project deps on Quart and Hypercorn , when I build the latest image yesterday, I found the quart cannot work.
After a hard check, I found it was caused by taskgroup's upgrading. It works well with taskgroup==0.0.0a4 but broken with taskgroup==0.1.1(also in 0.0.0a5). I thought it was because the new version taskgroup has some conflicts with my own task management. I'm trying to find it out, but this repository has much too little information, could you add a detailed README or other documentation for taskgroup ?Thank you.

@graingert
Copy link
Owner

I've provided a bit more info in #21

could you describe more about your issue? Does it fail in 3.11 or 3.12 in the same ways?

@graingert
Copy link
Owner

could you also try using anycorn instead of hypercorn and see if the issue persists?

@RockChinQ
Copy link
Author

Thank you so much for replying and for the PR. I just locked the version to 0.0.0a4 to temporarily solve this issue, but I haven't found the deep cause yet. I'll reply to this issue as soon as I work it out.

@M0N0Atomic
Copy link

I also encountered the same issue on python 3.9.x with following error

Traceback (most recent call last):
  File "..\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "..\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "..\lib\site-packages\hypercorn\asyncio\run.py", line 196, in asyncio_worker
    _run(
  File "..\lib\site-packages\hypercorn\asyncio\run.py", line 234, in _run
    runner.run(main(shutdown_trigger=shutdown_trigger))
  File "..\lib\site-packages\taskgroup\runners.py", line 127, in run
    task = _task_factory(self._loop, coro, context=context)
  File "..\lib\site-packages\taskgroup\tasks.py", line 89, in task_factory
    return Task(coro, loop=loop, **kwargs)
  File "..\lib\site-packages\taskgroup\tasks.py", line 63, in __init__
    coro = _Interceptor(coro, context)
TypeError: Can't instantiate abstract class _Interceptor with abstract method __await__
..\lib\multiprocessing\process.py:331: RuntimeWarning: coroutine 'worker_serve' was never awaited
  traceback.print_exc()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Happening in both anycorn and hypercorn while running with more than 1 workers.
Python 3.11 works fine

I saw #23, hopefully that fixes it.

@graingert graingert changed the title Add more information about this project Can't instantiate abstract class _Interceptor with abstract method __await__ Dec 15, 2024
@graingert
Copy link
Owner

ah ok looks like an easy fix (that wasn't fixed in #23), I'll get on it.

@graingert
Copy link
Owner

@M0N0Atomic can you check if this fixes it?

#25

@M0N0Atomic
Copy link

Yes that fixed it.

@graingert
Copy link
Owner

@M0N0Atomic thanks for the report, released in 0.2.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants