wicd does not honour LC_MESSAGES

Bug #326974 reported by David Paleino
4
Affects Status Importance Assigned to Milestone
wicd
Fix Released
Undecided
Dan O'Reilly

Bug Description

Hello,
a user in Debian reported a bug stating that wicd does not handle LC_MESSAGES. These are his locale settings:

  LANG=es_ES.UTF-8
  LC_TIME=C
  LC_NUMERIC=C
  LC_COLLATE=C
  LC_MESSAGES=C
  LC_ALL=

and wicd does come up in Spanish, instead of English ("C"). This applies to wicd 1.5.9, but I suspect it applies to previous versions too.

I'm attaching a patch fixing this, and also putting environment variables at a higher priority (i.e. before in the dictionary) than locale.getdefaultlocale() (if a user sets environment variables, she knows what she's doing)

I've applied this patch to the Debian package, and will upload the fixed version soon.

Kindly,
David
Debian maintainer of wicd

Revision history for this message
David Paleino (dpaleino) wrote :
Revision history for this message
Dan O'Reilly (oreilldf) wrote :

Thanks, David. I committed this fix to trunk and the 1.6 branch.

Changed in wicd:
assignee: nobody → oreilldf
status: New → Fix Committed
Revision history for this message
David Paleino (dpaleino) wrote :

Hello,
an update, since a Debian user reopened the bug I had fixed :(

I updated the patch with:

- lc, encoding = locale.getdefaultlocale()
+ # This avoids a bug: locale.getdefaultlocale() prefers
+ # LC_CTYPE over LANG/LANGUAGE
+ lc, encoding = locale.getdefaultlocale(envvars=('LC_MESSAGES', 'LC_ALL', 'LANG', 'LANGUAGE'))

This is because python's locale.getdefaultlocale() parses LC_CTYPE *before* LANG/LANGUAGE, which is *wrong* (LC_CTYPE is not for localized messages). Sure it's a locale (the python module) bug, but this workarounds it.

(to test: $ LANG=C LC_CTYPE=<yourlocale> wicd-client)

However, I believe that was somewhat broken. Why parts of the GUI used LC_MESSAGES/LANG and others used what returned by getdefaultlocale() ? I really believe only LC_MESSAGES (I'm not sure though) should be parsed.

Please fix this in 1.6.0. Apropos: any estimated release date? :)

(people filed other bugs/wishlists/requests/... to fix/implement, and I replied "I'll work on these on 1.6.0, since the code structure changed")

Ciao,
David

Revision history for this message
Dan O'Reilly (oreilldf) wrote :

Thanks, I applied this to 1.6.0. No release date set yet, though we're getting very close to a testing release.

Revision history for this message
Robby Workman (rworkman) wrote :

Closing ; this is fixed in the 1.6 alpha release

Changed in wicd:
status: Fix Committed → Fix Released
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.