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

Library doesnt work on Python 3.11.0 #61

Closed
shinrax2 opened this issue Oct 25, 2022 · 6 comments
Closed

Library doesnt work on Python 3.11.0 #61

shinrax2 opened this issue Oct 25, 2022 · 6 comments

Comments

@shinrax2
Copy link
Contributor

shinrax2 commented Oct 25, 2022

Summary

Libary fails on Python 3.11.0

Reproduction Steps

  1. Setup Python 3.11.0 & Novus
  2. import discord.ext.commands OR run python -m discord -v

Minimal Reproducible Code

import discord.ext.commands

Expected Results

Bot starts

Actual Results

Error:

  File "/home/bbs/bbsbot/test.py", line 1, in <module>
    import discord.ext.commands
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/site-packages/discord/ext/commands/__init__.py", line 20, in <module>
    from .flags import *
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/site-packages/discord/ext/commands/flags.py", line 72, in <module>
    @dataclass
     ^^^^^^^^^
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/dataclasses.py", line 1221, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/dataclasses.py", line 1211, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/dataclasses.py", line 959, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/dataclasses.py", line 816, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'discord.utils._MissingSentinel'> for field name is not allowed: use default_factory


### Intents

members, presences, guild_messages

### System Information

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/site-packages/discord/__main__.py", line 117, in <module>
    import voxelbotutils
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/site-packages/voxelbotutils/__init__.py", line 1, in <module>
    from discord.ext.vbu import *
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/site-packages/discord/ext/vbu/__init__.py", line 1, in <module>
    from . import runner
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/site-packages/discord/ext/vbu/runner.py", line 12, in <module>
    from discord.ext import commands
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/site-packages/discord/ext/commands/__init__.py", line 20, in <module>
    from .flags import *
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/site-packages/discord/ext/commands/flags.py", line 72, in <module>
    @dataclass
     ^^^^^^^^^
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/dataclasses.py", line 1221, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/dataclasses.py", line 1211, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/dataclasses.py", line 959, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bbs/.pyenv/versions/3.11.0/lib/python3.11/dataclasses.py", line 816, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'discord.utils._MissingSentinel'> for field name is not allowed: use default_factory

Python: 3.11.0
Arch: aarch64
Novus: 0.2.0
OS: Raspberry Pi OS 64bit (based on Debian 11)

### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.

### Additional Context

_No response_
@GameTec-live
Copy link
Contributor

its rapberrypios, i know that it should still work, but maybe you can try it on linux?

@shinrax2
Copy link
Contributor Author

shinrax2 commented Oct 27, 2022

it has nothing to do with raspberrypios its from changes in python 3.11.0
https://docs.python.org/3.11/whatsnew/3.11.html#dataclasses

@Silverdimond
Copy link

its rapberrypios, i know that it should still work, but maybe you can try it on linux?

Raspberry Pi OS is based on debian linux, therefore it is Linux
But which os novus is being run on has no bearing on python 3.11's breaking changes as previously said.

@GameTec-live
Copy link
Contributor

its rapberrypios, i know that it should still work, but maybe you can try it on linux?

Raspberry Pi OS is based on debian linux, therefore it is Linux But which os novus is being run on has no bearing on python 3.11's breaking changes as previously said.

i meant a different linux distro, i should have written "on a different OS/version"

@GameTec-live
Copy link
Contributor

makes sense, but that was something that came to mind, because i had enough issues with outdated stuff on raspi os

@shinrax2 shinrax2 mentioned this issue Nov 2, 2022
6 tasks
@sn8to
Copy link
Contributor

sn8to commented Nov 7, 2022

likely related to this issue on another library's repo: Pycord-Development/pycord#1752

the fix can likely be taken from this pull request: Pycord-Development/pycord#1680

@shinrax2 shinrax2 closed this as completed Nov 9, 2022
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

No branches or pull requests

4 participants