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

dataclass error #19

Closed
erentar opened this issue Jan 23, 2023 · 0 comments · Fixed by #20
Closed

dataclass error #19

erentar opened this issue Jan 23, 2023 · 0 comments · Fixed by #20

Comments

@erentar
Copy link

erentar commented Jan 23, 2023

When i outrun, this happens:

user:~/ $ outrun
Traceback (most recent call last):
  File "/home/user/.local/bin/outrun", line 5, in <module>
    from outrun.__main__ import main
  File "/home/user/.local/lib/python3.11/site-packages/outrun/__main__.py", line 21, in <module>
    import outrun.operations as operations
  File "/home/user/.local/lib/python3.11/site-packages/outrun/operations/__init__.py", line 48, in <module>
    from .remote import RemoteOperations
  File "/home/user/.local/lib/python3.11/site-packages/outrun/operations/remote.py", line 15, in <module>
    from outrun.config import Config
  File "/home/user/.local/lib/python3.11/site-packages/outrun/config.py", line 32, in <module>
    @dataclass
     ^^^^^^^^^
  File "/usr/lib64/python3.11/dataclasses.py", line 1220, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/usr/lib64/python3.11/dataclasses.py", line 1210, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/dataclasses.py", line 958, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/dataclasses.py", line 815, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'outrun.config.CacheConfig'> for field cache is not allowed: use default_factory

Python version is 3.11, although same error happens with 3.7 too.

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.

1 participant