gnome 语言选择器拒绝设置语言

gnome 语言选择器拒绝设置语言

当我gnome-language-selector以普通用户身份运行时,将新语言拖放到默认英语上方后,我会得到以下输出。

/usr/lib/python2.7/dist-packages/LanguageSelector/LocaleInfo.py:124: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if lang_name == self._lang[lang]:
debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Ikke tilgang
debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Ikke tilgang
debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Ikke tilgang
debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Ikke tilgang
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 62, in wrapper
    res = f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 1047, in on_treeview_locales_drag_end
    self.writeUserLanguage(envLanguage)
  File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 800, in writeUserLanguage
    self.writeUserLanguageSetting(userLanguage=languageString)
  File "/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py", line 83, in writeUserLanguageSetting
    iface.SetLanguage(userLanguage)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.Accounts.Error.Failed: not access to HOME yet so language not saved
(Ikke tilgang -> not allowed)

我说,好吧,这似乎是权限问题。所以我以 root 身份重新运行它,并出现以下错误:

$ sudo gnome-language-selector 
/usr/lib/python2.7/dist-packages/LanguageSelector/LocaleInfo.py:124: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if lang_name == self._lang[lang]:
/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py:77: UserWarning: No language saved for user 'root'.
  warnings.warn("No language saved for user '%s'." % os.getenv('USER'))

有人知道是什么原因造成的吗?或者我可以做什么来调试/修复这个问题?

答案1

我遇到了类似的问题。原因是.profile我的主目录中缺少一个文件。

解决方案:打开终端并在其中运行以下命令:

cp /etc/skel/.profile ~/

然后在 gnome-language-selector 中更改语言。

错误 1018621了解更多信息。

如果上述解决方案对您不起作用,请尝试在网上搜索该 unicode 警告(第 1-2 行)或那些 debconf 警告(第 3-6 行)。我没有收到这些警告。

相关内容