[Bug 65935] German Display Settings "fail to load" because of locale.py

Eric Thomas gwar_drazul at gmx.net
Thu Apr 19 14:39:15 UTC 2007


You have been subscribed to a public bug:

1.) Install Kubuntu drapper drake (6.06) using German Keyboard layout
and language settings and download German language package.

2.) enable "universe" and "multiverse" in Adept

3.) download all updates using Adept

4.) open "Sytem settings" (which are "Systemeinstellungen" in Germany")

5.) Try to open the settings for display ("Anzeige")

6.) it shows a "failed to load" message ("Das Modul Anzeige kann nicht
gefunden werden")

I found out that the module can be manually invoked by entering
"kcmshell displayconfig" in the shell.

I got the following error messages:
[BEGIN]
Traceback (most recent call last):
  File "<string>", line 8, in kcontrol_bridge_create_displayconfig
  File "/usr/lib/python2.4/site-packages/displayconfig.py", line 1677, in create_displayconfig
    return DisplayApp(parent, name)
  File "/usr/lib/python2.4/site-packages/displayconfig.py", line 443, in __init__
    self.xsetup = XSetup(self.xconfigpath)
  File "/usr/lib/python2.4/site-packages/displayconfigabstraction.py", line 73, in __init__
    self.xorg_config = xorgconfig.readConfig(xorg_config_filename)
  File "/usr/lib/python2.4/site-packages/xorgconfig.py", line 641, in readConfig
    for row in XorgconfCVSReader(filename=filename).readlines():
  File "/usr/lib/python2.4/site-packages/xorgconfig.py", line 696, in __init__
    fhandle = codecs.open(filename,'r',locale.getpreferredencoding(),'replace')
  File "/usr/lib/python2.4/locale.py", line 419, in getpreferredencoding
    setlocale(LC_CTYPE, "")
  File "/usr/lib/python2.4/locale.py", line 382, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
error: *** runFunction failure
;
[END]
Note: Line numbers might have changed a little due to my bug tracking

Upon further investigation I finally found the function call responsible for this bug:
in file /usr/lib/python2.4/locale.py, approximately line 418 there is the following code:
oldloc = setlocale(LC_CTYPE)
setlocale(LC_CTYPE, "")
result = nl_langinfo(CODESET)
setlocale(LC_CTYPE, oldloc)

calling "setlocale(LC_CTYPE, "")" causes an error (locale.Error:
unsupported locale setting)

calling the function like that: setlocale(LC_CTYPE, "C") or rewriting the code like this:
try:
  setlocale(LC_CTYPE, "")
except:
  pass

fixes the problem.

Best regards,
Eric

** Affects: adept (Ubuntu)
     Importance: Undecided
     Assignee: txwikinger
         Status: Needs Info

-- 
German Display Settings "fail to load" because of locale.py
https://bugs.launchpad.net/bugs/65935




More information about the kubuntu-bugs mailing list