Package: osc
Version: 0.134.1-2
Severity: normal
Tags: l10n

Using locale.getdefaultlocale() for encoding detection breaks with
locales that use modifiers, such as de_DE@euro, or ca_ES@valencia.
Use locale.getpreferredencoding() instead, which should do the right
thing.

Patch attached, fixes the issue for me, but please take it easy. :)

Jordi

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=ca_ES.UTF-8@valencia, LC_CTYPE=ca_ES.UTF-8@valencia (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages osc depends on:
ii  python             2.7.3-1
ii  python-m2crypto    0.21.1-2
ii  python-rpm         4.10.0-4
ii  python-urlgrabber  3.9.1-4
ii  python2.6          2.6.8-0.2
ii  python2.7          2.7.3-1

Versions of packages osc recommends:
ii  cpio            2.11-8
ii  rpm2cpio        4.10.0-4
ii  sensible-utils  0.0.7

Versions of packages osc suggests:
ii  gnome-keyring        3.4.1-4
ii  python-gnomekeyring  2.32.0+dfsg-2+b1

-- no debconf information

-- 
Jordi Mallach PĂ©rez  --  Debian developer     http://www.debian.org/
jo...@sindominio.net     jo...@debian.org     http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/
Author: Jordi Mallach <jordi.mall...@collabora.co.uk>
Description: Fix locale encoding extraction
 Using locale.getdefaultlocale() for encoding detection breaks with
 locales that use modifiers, such as de_DE@euro, or ca_ES@valencia.
 Use locale.getpreferredencoding() instead, which should do the right
 thing.
Forwarded: no

Index: osc-0.134.1/osc-wrapper.py
===================================================================
--- osc-0.134.1.orig/osc-wrapper.py	2011-12-20 22:55:35.000000000 +0100
+++ osc-0.134.1/osc-wrapper.py	2012-07-20 21:26:50.862591488 +0200
@@ -11,9 +11,9 @@
 # this is a hack to make osc work as expected with utf-8 characters,
 # no matter how site.py is set...
 reload(sys)
-loc = locale.getdefaultlocale()[1]
+loc = locale.getpreferredencoding()
 if not loc:
-    loc = sys.getdefaultencoding()
+    loc = sys.getpreferredencoding()
 sys.setdefaultencoding(loc)
 del sys.setdefaultencoding
 

Attachment: signature.asc
Description: Digital signature

Reply via email to