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

cinnamon-settings applets crashes #8956

Closed
Bednar87 opened this issue Nov 14, 2019 · 12 comments
Closed

cinnamon-settings applets crashes #8956

Bednar87 opened this issue Nov 14, 2019 · 12 comments

Comments

@Bednar87
Copy link

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
@leigh123linux
Copy link
Contributor

Post

which ngettext

@caseyjp11
Copy link

caseyjp11 commented Nov 15, 2019

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?

@claudiux
Copy link
Member

Hi @Bednar87,

Try:

pacman -Suy gettext

@Bednar87
Copy link
Author

Bednar87 commented Nov 15, 2019

Hi guys, I already have gettext installed

> $ which ngettext                                                                                                                                             
/usr/bin/ngettext

Hi @Bednar87,

Try:

pacman -Suy gettext

Tried, no change.

@leigh123linux
Copy link
Contributor

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.

@wvandelli
Copy link

wvandelli commented Nov 15, 2019

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

@mammo0
Copy link

mammo0 commented Nov 15, 2019

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 sound@cinnamon.org: '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.

@spsf64
Copy link

spsf64 commented Nov 15, 2019

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

@claudiux
Copy link
Member

@spsf64 You can now reinstall the Spices Update applet. Please take a look at https://cinnamon-spices.linuxmint.com/applets/view/309#count.

@claudiux
Copy link
Member

@spsf64 Argh ! Unable to download the latest version (5.1.0) of Spices Update on Arch. I'm searching...

@claudiux
Copy link
Member

claudiux commented Nov 15, 2019

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: linuxmint/cinnamon-spices-applets#2683
@claudiux

@Bednar87
Copy link
Author

@claudiux

Thanks, SpicesUpdate v5.1.1 resolves this issue.

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.

7 participants