[Python-apps-commits] r2496 - in packages/wicd/trunk/debian (2 files)

hanska-guest at users.alioth.debian.org hanska-guest at users.alioth.debian.org
Fri Feb 27 21:15:00 UTC 2009


    Date: Friday, February 27, 2009 @ 21:14:59
  Author: hanska-guest
Revision: 2496

* debian/patches/:
  - 06-add_LC_MESSAGES_parsing.patch updated: workaround "bug" in
    python's locale.getdefaultlocale(), putting LC_CTYPE at a higher
    priority than LC_MESSAGES (well, not considering it at all)
    (really closes: #514553)

Modified:
  packages/wicd/trunk/debian/changelog
  packages/wicd/trunk/debian/patches/06-add_LC_MESSAGES_parsing.patch

Modified: packages/wicd/trunk/debian/changelog
===================================================================
--- packages/wicd/trunk/debian/changelog	2009-02-27 19:56:38 UTC (rev 2495)
+++ packages/wicd/trunk/debian/changelog	2009-02-27 21:14:59 UTC (rev 2496)
@@ -4,8 +4,13 @@
   * debian/postinst:
     - only force-reload DBus if it's already started (Closes: #517395),
       I had already fixed this in debian/postrm (see -2).
+  * debian/patches/:
+    - 06-add_LC_MESSAGES_parsing.patch updated: workaround "bug" in
+      python's locale.getdefaultlocale(), putting LC_CTYPE at a higher
+      priority than LC_MESSAGES (well, not considering it at all)
+      (really closes: #514553)
 
- -- David Paleino <d.paleino at gmail.com>  Fri, 27 Feb 2009 20:52:04 +0100
+ -- David Paleino <d.paleino at gmail.com>  Fri, 27 Feb 2009 22:10:05 +0100
 
 wicd (1.5.9-2) unstable; urgency=low
 

Modified: packages/wicd/trunk/debian/patches/06-add_LC_MESSAGES_parsing.patch
===================================================================
--- packages/wicd/trunk/debian/patches/06-add_LC_MESSAGES_parsing.patch	2009-02-27 19:56:38 UTC (rev 2495)
+++ packages/wicd/trunk/debian/patches/06-add_LC_MESSAGES_parsing.patch	2009-02-27 21:14:59 UTC (rev 2496)
@@ -1,12 +1,12 @@
 Also parse LC_MESSAGES from environment variables, and also put them at
 higher priority than locale.getdefaultlocale()
 ---
- wicd/misc.py |   12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
+ wicd/misc.py |   16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
 
 --- wicd-1.5.9.orig/wicd/misc.py
 +++ wicd-1.5.9/wicd/misc.py
-@@ -316,6 +316,13 @@ def get_gettext():
+@@ -316,17 +316,23 @@ def get_gettext():
      # http://www.learningpython.com/2006/12/03/translating-your-pythonpygtk-application/
      local_path = wpath.translations
      langs = []
@@ -18,9 +18,12 @@
 +    if osLanguage:
 +        langs += osLanguage.split(":")
      try:
-         lc, encoding = locale.getdefaultlocale()
+-        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'))
      except ValueError, e:
-@@ -323,10 +330,7 @@ def get_gettext():
+         print str(e)
          print "Default locale unavailable, falling back to en_US"
          lc = None
      if lc:




More information about the Python-apps-commits mailing list