diff -u python2.6-2.6.2/debian/rules python2.6-2.6.2/debian/rules --- python2.6-2.6.2/debian/rules +++ python2.6-2.6.2/debian/rules @@ -974,6 +974,7 @@ platform-lsbrelease \ issue1113244 \ bdist-wininst-notfound \ + locales-without-encoding \ # setup-modules \ # profiled-build \ diff -u python2.6-2.6.2/debian/changelog python2.6-2.6.2/debian/changelog --- python2.6-2.6.2/debian/changelog +++ python2.6-2.6.2/debian/changelog @@ -1,3 +1,10 @@ +python2.6 (2.6.2-0ubuntu2~ppa2) jaunty; urgency=low + + * debian/patches/locales-without-encoding.dpatch: + - Allow locales with no specified encoding. (Closes LP: #223281) + + -- Jonathan Marsden Sat, 07 Nov 2009 23:35:46 -0800 + python2.6 (2.6.2-0ubuntu1) jaunty; urgency=low * Final Python 2.6.2 release (no code changes compared to last upload). diff -u python2.6-2.6.2/debian/patches/series python2.6-2.6.2/debian/patches/series --- python2.6-2.6.2/debian/patches/series +++ python2.6-2.6.2/debian/patches/series @@ -14,6 +14,7 @@ webbrowser linecache doc-nodownload +locales-without-encoding # FIXME #arm-float, for arm only only in patch2: unchanged: --- python2.6-2.6.2.orig/debian/patches/locales-without-encoding.dpatch +++ python2.6-2.6.2/debian/patches/locales-without-encoding.dpatch @@ -0,0 +1,49 @@ +#! /bin/sh -e +# Description: Allow locales with no specified encoding +# Origin: http://bugs.python.org/file14881/locale.py-parselocale-patch.diff +# Bug: http://bugs.python.org/issue6895 +# Bug-Ubuntu: https://launchpad.net/bugs/223281 + +# DP: * Lib/locale.py: +# DP: - Allow locales with no specified encoding. (Closes LP: #223281) + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "usage: `basename $0`: -patch|-unpatch [-d ]" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + ;; + *) + echo >&2 "usage: `basename $0`: -patch|-unpatch [-d ]" + exit 1 +esac +exit 0 + +--- Lib/locale.py~ 2009-03-18 11:34:06.000000000 -0700 ++++ Lib/locale.py 2009-11-07 23:41:37.000000000 -0800 +@@ -402,11 +402,13 @@ + # since some systems may use other encodings for these + # locales. Also, we ignore other modifiers. + return code, 'iso-8859-15' +- ++ if code == 'C': ++ return None, None + if '.' in code: + return tuple(code.split('.')[:2]) +- elif code == 'C': +- return None, None ++ else: ++ # locale name value does not have encoding information ++ return code, None + raise ValueError, 'unknown locale: %s' % localename + + def _build_localename(localetuple):