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

Type Issue in typings/misc.py - Not 3.8 compatible (reported from mafic support discord) #109

Open
2 tasks done
dlchamp opened this issue Dec 7, 2023 · 0 comments
Open
2 tasks done
Labels
t: unconfirmed bug Type: bug - needs testing on if this is an issue

Comments

@dlchamp
Copy link

dlchamp commented Dec 7, 2023

Summary

Exception thrown when running mafic on python 3.8

Reproduction Steps

Import mafic while using Python 3.8

Minimal Reproducible Code

`import mafic`

Expected Results

No errors when running bot that includes Mafic

Actual Results

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/disnake/ext/commands/common_bot_base.py", line 452, in _load_from_module_spec
    spec.loader.exec_module(lib)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/project/mikis/modules/music/play.py", line 3, in <module>
    import mafic
  File "/usr/local/lib/python3.8/dist-packages/mafic/__init__.py", line 15, in <module>
    from .node import *
  File "/usr/local/lib/python3.8/dist-packages/mafic/node.py", line 32, in <module>
    from .typings import (
  File "/usr/local/lib/python3.8/dist-packages/mafic/typings/__init__.py", line 4, in <module>
    from .common import *
  File "/usr/local/lib/python3.8/dist-packages/mafic/typings/common.py", line 7, in <module>
    from .misc import PayloadWithGuild
  File "/usr/local/lib/python3.8/dist-packages/mafic/typings/misc.py", line 16, in <module>
    Coro = Coroutine[Any, Any, T]
TypeError: 'ABCMeta' object is not subscriptable

Lavalink Information

Not applicable

System Information

Reported in Tooty Town by multiple users. Users were using 3.8 and latest Mafic available on PyPi

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.

Additional Context

I'm not super familiar with types, but my Google-fu led me to the answer that from collections.abc import Coroutine is not compatible with Python 3.8.

So, pyproject should be updated to show that 3.9 is the minimum Python version that is supported and users having this issue should update or the import statement for Coroutine should be from typing import Coroutine instead to maintain 3.8 compatibility

@dlchamp dlchamp added the t: unconfirmed bug Type: bug - needs testing on if this is an issue label Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: unconfirmed bug Type: bug - needs testing on if this is an issue
Projects
None yet
Development

No branches or pull requests

1 participant