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

[Windows] ValueError: mutable default <class 'PySide6.QtGui.QImage'> for field image is not allowed: use default_factory #311

Closed
Explorare opened this issue Nov 18, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Explorare
Copy link

[env]
Windows 10 22H2 64-bit
Python 3.11.0
normcap 0.3.14

I just updated normcap via pip and it failed to launch.

[log]

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\explo\scoop\apps\python\current\Scripts\normcap.exe\__main__.py", line 4, in <module>
  File "C:\Users\explo\scoop\apps\python\current\Lib\site-packages\normcap\app.py", line 13, in <module>
    from normcap.gui import system_info, utils
  File "C:\Users\explo\scoop\apps\python\current\Lib\site-packages\normcap\gui\system_info.py", line 14, in <module>
    from normcap.gui.models import DesktopEnvironment, Rect, Screen
  File "C:\Users\explo\scoop\apps\python\current\Lib\site-packages\normcap\gui\models.py", line 147, in <module>
    @dataclass()
     ^^^^^^^^^^^
  File "C:\Users\explo\scoop\apps\python\current\Lib\dataclasses.py", line 1211, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\explo\scoop\apps\python\current\Lib\dataclasses.py", line 959, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\explo\scoop\apps\python\current\Lib\dataclasses.py", line 816, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'PySide6.QtGui.QImage'> for field image is not allowed: use default_factory
@dynobo dynobo self-assigned this Nov 18, 2022
@dynobo dynobo added the bug Something isn't working label Nov 18, 2022
@dynobo dynobo closed this as completed in 5fa36a1 Nov 18, 2022
@dynobo
Copy link
Owner

dynobo commented Nov 18, 2022

Should be fixed, new release is coming in the next days... Thanks for reporting the issue! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants