German Display Settings "fail to load" because of locale.py

Bug #65935 reported by Eric Thomas
4
Affects Status Importance Assigned to Milestone
adept (Ubuntu)
Invalid
Undecided
Ralph Janke

Bug Description

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

Revision history for this message
Ralph Janke (txwikinger) wrote :

I can't reproduce this on feisty. Is that Bug still current?

Thanks.

Changed in python2.5:
assignee: nobody → rjanke
status: Unconfirmed → Needs Info
Revision history for this message
Ralph Janke (txwikinger) wrote :

I have not gotten any feedback for 2 month, therefore I close this report. If there is more information please re-open,

Thanks

Changed in adept:
status: Needs Info → Rejected
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.