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

PySide6.QtDBus.QDBusMessage is not deepcopyable #277

Open
w568w opened this issue Mar 13, 2024 · 1 comment
Open

PySide6.QtDBus.QDBusMessage is not deepcopyable #277

w568w opened this issue Mar 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@w568w
Copy link
Contributor

w568w commented Mar 13, 2024

What happened?

When a DBusPlugin (e.g. _Budgie, _Kde) calls DBusPlugin.create_message, an error occurs at:

def create_message(self, theme: str) -> QDBusMessage:
message = copy.deepcopy(self.base_message)
message.setArguments([theme])
return message


QDBusMessage does implement __copy__. But as the documentation says,

QDBusMessage objects are shared. Modifications made to the copy will affect the original one as well.

So it might be better to change base_message to base_message_factory (or base_message_creator)?

Version

Build from master (f72bfff)

How did you install Yin & Yang?

AUR

What desktop environments are you seeing the problem on?

KDE

Which plugin causes the issue?

GTK

What software version do you use?

n/a

Relevant log output

Exception in thread GTK:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/yin-yang/yin_yang/plugins/_plugin.py", line 56, in set_mode
    self.set_theme(theme)
  File "/opt/yin-yang/yin_yang/plugins/_plugin.py", line 208, in set_theme
    self.strategy.set_theme(theme)
  File "/opt/yin-yang/yin_yang/plugins/gtk.py", line 96, in set_theme
    response = self.call(self.create_message(theme))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/yin-yang/yin_yang/plugins/_plugin.py", line 272, in create_message
    message = copy.deepcopy(self.base_message)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/copy.py", line 161, in deepcopy
    rv = reductor(4)
         ^^^^^^^^^^^
TypeError: cannot pickle 'PySide6.QtDBus.QDBusMessage' object
@w568w w568w added the bug Something isn't working label Mar 13, 2024
@cheanus
Copy link

cheanus commented Mar 20, 2024

Same log output and error on Arch, KDE 6

l0drex added a commit that referenced this issue Apr 3, 2024
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

Successfully merging a pull request may close this issue.

2 participants