diff options
author | Jesus Rivero <neurogeek@gentoo.org> | 2008-12-13 20:54:39 +0000 |
---|---|---|
committer | Jesus Rivero <neurogeek@gentoo.org> | 2008-12-13 20:54:39 +0000 |
commit | bb55ca3b5dac43ce11787bc4a147ef6547201bcb (patch) | |
tree | cab84c00a96ee7dff400757f46672fc1b9eb96b9 /dev-lang/python/files | |
parent | Changed maintainer to net-p2p, acked by armin76 (diff) | |
download | gentoo-2-bb55ca3b5dac43ce11787bc4a147ef6547201bcb.tar.gz gentoo-2-bb55ca3b5dac43ce11787bc4a147ef6547201bcb.tar.bz2 gentoo-2-bb55ca3b5dac43ce11787bc4a147ef6547201bcb.zip |
Version bump
(Portage version: 2.2_rc16/cvs/Linux 2.6.18-gentoo-r3 i686)
Diffstat (limited to 'dev-lang/python/files')
-rw-r--r-- | dev-lang/python/files/python-2.6_turkish.patch | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/dev-lang/python/files/python-2.6_turkish.patch b/dev-lang/python/files/python-2.6_turkish.patch new file mode 100644 index 000000000000..2eb50527eed7 --- /dev/null +++ b/dev-lang/python/files/python-2.6_turkish.patch @@ -0,0 +1,130 @@ +diff -uNr Python-2.6.1.orig/Lib/decimal.py Python-2.6.1/Lib/decimal.py +--- Python-2.6.1.orig/Lib/decimal.py 2008-12-13 14:30:59.000000000 -0430 ++++ Python-2.6.1/Lib/decimal.py 2008-12-13 14:32:59.000000000 -0430 +@@ -152,6 +152,13 @@ + ROUND_HALF_DOWN = 'ROUND_HALF_DOWN' + ROUND_05UP = 'ROUND_05UP' + ++import string ++ ++def ascii_upper(s): ++ trans_table = string.maketrans(string.ascii_lowercase, string.ascii_uppercase) ++ return s.translate(trans_table) ++ ++ + # Errors + + class DecimalException(ArithmeticError): +@@ -3563,7 +3570,7 @@ + if name.startswith('_round_')] + for name in rounding_functions: + # name is like _round_half_even, goes to the global ROUND_HALF_EVEN value. +- globalname = name[1:].upper() ++ globalname = ascii_upper(name[1:]) + val = globals()[globalname] + Decimal._pick_rounding_function[val] = name + +diff -uNr Python-2.6.1.orig/Lib/email/__init__.py Python-2.6.1/Lib/email/__init__.py +--- Python-2.6.1.orig/Lib/email/__init__.py 2008-12-13 14:30:59.000000000 -0430 ++++ Python-2.6.1/Lib/email/__init__.py 2008-12-13 14:34:13.000000000 -0430 +@@ -109,15 +109,19 @@ + 'Text', + ] + ++import string ++lower_map = string.maketrans(string.ascii_uppercase, string.ascii_lowercase) ++ ++ + for _name in _LOWERNAMES: +- importer = LazyImporter(_name.lower()) ++ importer = LazyImporter(_name.translate(lower_map)) + sys.modules['email.' + _name] = importer + setattr(sys.modules['email'], _name, importer) + + + import email.mime + for _name in _MIMENAMES: +- importer = LazyImporter('mime.' + _name.lower()) ++ importer = LazyImporter('mime.' + _name.translate(lower_map)) + sys.modules['email.MIME' + _name] = importer + setattr(sys.modules['email'], 'MIME' + _name, importer) + setattr(sys.modules['email.mime'], _name, importer) +diff -uNr Python-2.6.1.orig/Lib/locale.py Python-2.6.1/Lib/locale.py +--- Python-2.6.1.orig/Lib/locale.py 2008-12-13 14:30:59.000000000 -0430 ++++ Python-2.6.1/Lib/locale.py 2008-12-13 14:57:18.000000000 -0430 +@@ -294,6 +294,14 @@ + # overridden below) + _setlocale = setlocale + ++# Avoid relying on the locale-dependent .lower() method ++# (see bug #1813). ++_ascii_lower_map = ''.join( ++ chr(x + 32 if x >= ord('A') and x <= ord('Z') else x) ++ for x in range(256) ++) ++ ++ + def normalize(localename): + + """ Returns a normalized locale code for the given locale +@@ -311,7 +319,7 @@ + + """ + # Normalize the locale name and extract the encoding +- fullname = localename.lower() ++ fullname = localename.translate(_ascii_lower_map) + if ':' in fullname: + # ':' is sometimes used as encoding delimiter. + fullname = fullname.replace(':', '.') +diff -uNr Python-2.6.1.orig/Lib/test/test_codecs.py Python-2.6.1/Lib/test/test_codecs.py +--- Python-2.6.1.orig/Lib/test/test_codecs.py 2008-12-13 14:30:59.000000000 -0430 ++++ Python-2.6.1/Lib/test/test_codecs.py 2008-12-13 14:58:33.000000000 -0430 +@@ -1,5 +1,6 @@ + from test import test_support + import unittest ++import locale + import codecs + import sys, StringIO, _testcapi + +@@ -1078,6 +1079,16 @@ + self.assertRaises(LookupError, codecs.lookup, "__spam__") + self.assertRaises(LookupError, codecs.lookup, " ") + ++ def test_lookup_with_locale(self): ++ # Bug #1813: when normalizing codec name, lowercasing must be locale ++ # agnostic, otherwise the looked up codec name might end up wrong. ++ try: ++ locale.setlocale(locale.LC_CTYPE, 'tr') ++ except locale.Error: ++ # SKIPped test ++ return ++ codecs.lookup('ISO8859_1') ++ + def test_getencoder(self): + self.assertRaises(TypeError, codecs.getencoder) + self.assertRaises(LookupError, codecs.getencoder, "__spam__") +diff -uNr Python-2.6.1.orig/Python/codecs.c Python-2.6.1/Python/codecs.c +--- Python-2.6.1.orig/Python/codecs.c 2008-12-13 14:31:00.000000000 -0430 ++++ Python-2.6.1/Python/codecs.c 2008-12-13 14:59:43.000000000 -0430 +@@ -45,6 +45,12 @@ + return -1; + } + ++/* isupper() forced into the ASCII Locale */ ++#define ascii_isupper(x) (((x) >= 0x41) && ((x) <= 0x5A)) ++/* tolower() forced into the ASCII Locale */ ++#define ascii_tolower(x) (ascii_isupper(x) ? ((x) + 0x20) : (x)) ++ ++ + /* Convert a string to a normalized Python string: all characters are + converted to lower case, spaces are replaced with underscores. */ + +@@ -70,7 +76,7 @@ + if (ch == ' ') + ch = '-'; + else +- ch = tolower(Py_CHARMASK(ch)); ++ ch = ascii_tolower(Py_CHARMASK(ch)); + p[i] = ch; + } + return v; |