og
Issue
cinnamon-settings applets crashes
Steps to reproduce
launch cinnamon-settings applets
Expected behaviour
Other information
> $ cinnamon-settings applets
True
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:421: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if category.int_name is not "custom":
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:430: SyntaxWarning: "is" with a literal. Did you mean "=="?
if category.int_name is "custom":
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:445: SyntaxWarning: "is" with a literal. Did you mean "=="?
if category.int_name is "custom":
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:455: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if entry is not "_invalid_":
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:538: SyntaxWarning: "is" with a literal. Did you mean "=="?
if cat[2].int_name is "custom":
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:576: SyntaxWarning: "is" with a literal. Did you mean "=="?
if cat[2].int_name is "custom":
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:602: SyntaxWarning: "is" with a literal. Did you mean "=="?
if cat[2].int_name is "custom":
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:693: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if entry is not "":
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:733: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if entry is not "":
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:779: SyntaxWarning: "is not" with a literal. Did you mean "!="?
ok_enabled = self.name_entry.get_text().strip() is not "" and self.command_entry.get_text().strip() is not ""
/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py:779: SyntaxWarning: "is not" with a literal. Did you mean "!="?
ok_enabled = self.name_entry.get_text().strip() is not "" and self.command_entry.get_text().strip() is not ""
Using pam module (python3-pampy)
/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py:423: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
self.window.set_wmclass(wm_class, wm_class)
Loading Applets module
Traceback (most recent call last):
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 724, in <module>
window = MainWindow()
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 428, in __init__
self.go_to_sidepage(cat, path, user_action=False)
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 185, in go_to_sidepage
sidePage.build()
File "/usr/share/cinnamon/cinnamon-settings/bin/SettingsWidgets.py", line 123, in build
self.module.on_module_selected()
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_applets.py", line 21, in on_module_selected
self.sidePage.load(self.window)
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_applets.py", line 46, in load
download_applets_page = DownloadSpicesPage(self, self.collection_type, self.spices, window)
File "/usr/share/cinnamon/cinnamon-settings/bin/ExtensionCore.py", line 810, in __init__
self.build_list()
File "/usr/share/cinnamon/cinnamon-settings/bin/ExtensionCore.py", line 897, in build_list
msg_text = _("Update all") + ' (' + ngettext("%d update available", "%d updates available", updates_available) % updates_available + ')'
NameError: name 'ngettext' is not defined
Post
which ngettext
Same issue on Arch. Clicking "Themes" from settings does nothing. Running "Cinnamon-settings" from the terminal provides what the user above pasted. As we've recently had major upgrades to python, is this possibly the culprit?
Hi @Bednar87,
Try:
pacman -Suy gettext
Hi guys, I already have gettext installed
> $ which ngettext
/usr/bin/ngettext
Hi @Bednar87,
Try:
pacman -Suy gettext
Tried, no change.
Same issue on Arch. Clicking "Themes" from settings does nothing. Running "Cinnamon-settings" from the terminal provides what the user above pasted. As we've recently had major upgrades to python, is this possibly the culprit?
I can check to see if it see if it still works ok with python-3.8 next time I boot Rawhide.
Same problem here on a freshly updated Arch Linux.
This is how I fixed it:
~ $ diff /tmp/ExtensionCore.py /usr/share/cinnamon/cinnamon-settings/bin/ExtensionCore.py
897c897
< msg_text = _("Update all") + ' (' + ngettext("%d update available", "%d updates available", updates_available) % updates_available + ')'
---
> msg_text = _("Update all") + ' (' + gettext.ngettext("%d update available", "%d updates available", updates_available) % updates_available + ')'
The module name is missing in ExtensionCore.py, line 897
I think this has to do with the update to Python version 3.8 on Arch Linux. After the update I get the above described error as well.
I fixed it temporary by changing the import gettext line to:
from gettext import *
But there are several other errors when using the applet settings module:
Traceback (most recent call last):
File "/usr/share/cinnamon/cinnamon-settings/bin/ExtensionCore.py", line 917, in on_page_shown
if show_prompt(prompt, self.window):
File "/usr/share/cinnamon/cinnamon-settings/bin/ExtensionCore.py", line 98, in show_prompt
esc = cgi.escape(msg)
For this error I found the following solution: https://bugzilla.redhat.com/show_bug.cgi?id=1702082
So I changed the line import cgi to:
import html as cgi
It seems that this module was renamed in Python 3.8?
Another error is that there are no installed applets listed. Instead I get for all my installed applets:
Failed to load extension [email protected]: 'function' object has no attribute 'translation'
So long story short: I think that the current cinnamon version is not completely compatible with Python 3.8.
Edit:
Ignore my import fix above for gettext. Instead use the one of @wvandelli. Then the list of installed applets is not empty.
In my case the culprit was the Spices Update applet
I removed it from the panel then deleted the directory "/home/$USER/.local/share/cinnamon/applets/SPICES-APPPLET"
Not it works again!
But launching cinnamon-settings from terminal still show plenty of "cs_keyboard.py" warnings as in the OP
@spsf64 You can now reinstall the Spices Update applet. Please take a look at https://cinnamon-spices.linuxmint.com/applets/view/309#count.
@spsf64 Argh ! Unable to download the latest version (5.1.0) of Spices Update on Arch. I'm searching...
Thank you @wvandelli.
@spsf64
For SpicesUpdate to work properly with Python 3.8, edit line 32 of the ~/.local/share/cinnamon/applets/SpicesUpdate@claudiux/cs/4.2/cinnamon-settings.py file.
From:
gettext.install("cinnamon", "/usr/share/locale", names="ngettext")
To:
gettext.install("cinnamon", "/usr/share/locale", names="gettext.ngettext")
I'll make a PR. Version 5.1.1 of Spices Update will be available soon.
EDIT: https://github.com/linuxmint/cinnamon-spices-applets/pull/2683
@claudiux
@claudiux
Thanks, SpicesUpdate v5.1.1 resolves this issue.
Most helpful comment
Same problem here on a freshly updated Arch Linux.
This is how I fixed it:
The module name is missing in ExtensionCore.py, line 897