~ubuntu-branches/ubuntu/oneiric/python2.5/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/issue1813.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-07-31 17:46:11 UTC
  • Revision ID: james.westby@ubuntu.com-20080731174611-wbwz8ie7lzrne1fp
Tags: 2.5.2-10ubuntu1
* Merge with Debian; remaining changes:
  - Include the pregenerated documentation.
  - Set priority of python2.5-minimal to required.
  - Build python2.5-doc from the pregenerated documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh -e
 
2
 
 
3
# DP: Fix issues with turkish locale.
 
4
 
 
5
dir=
 
6
if [ $# -eq 3 -a "$2" = '-d' ]; then
 
7
    pdir="-d $3"
 
8
    dir="$3/"
 
9
elif [ $# -ne 1 ]; then
 
10
    echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
 
11
    exit 1
 
12
fi
 
13
case "$1" in
 
14
    -patch)
 
15
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
 
16
        ;;
 
17
    -unpatch)
 
18
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
 
19
        ;;
 
20
    *)
 
21
        echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
 
22
        exit 1
 
23
esac
 
24
exit 0
 
25
 
 
26
--- Lib/decimal.py      2008-01-08 23:42:03.000000000 +0200
 
27
+++ Lib/decimal.py      2008-01-15 05:21:33.000000000 +0200
 
28
@@ -146,6 +146,12 @@
 
29
 ROUND_HALF_DOWN = 'ROUND_HALF_DOWN'
 
30
 ROUND_05UP = 'ROUND_05UP'
 
31
 
 
32
+import string
 
33
+
 
34
+def ascii_upper(s):
 
35
+    trans_table = string.maketrans(string.ascii_lowercase, string.ascii_uppercase)
 
36
+    return s.translate(trans_table)
 
37
+
 
38
 # Errors
 
39
 
 
40
 class DecimalException(ArithmeticError):
 
41
@@ -3354,7 +3366,7 @@
 
42
                                     if name.startswith('_round_')]
 
43
 for name in rounding_functions:
 
44
     # name is like _round_half_even, goes to the global ROUND_HALF_EVEN value.
 
45
-    globalname = name[1:].upper()
 
46
+    globalname = ascii_upper(name[1:])
 
47
     val = globals()[globalname]
 
48
     Decimal._pick_rounding_function[val] = name
 
49
 
 
50
--- Python/codecs.c     2006-06-23 17:16:18.000000000 -0400
 
51
+++ Python/codecs.c     2007-10-30 12:51:10.000000000 -0400
 
52
@@ -45,6 +45,11 @@ int PyCodec_Register(PyObject *search_fu
 
53
     return -1;
 
54
 }
 
55
 
 
56
+/* isupper() forced into the ASCII Locale */
 
57
+#define ascii_isupper(x) (((x) >= 0x41) && ((x) <= 0x5A))
 
58
+/* tolower() forced into the ASCII Locale */
 
59
+#define ascii_tolower(x) (ascii_isupper(x) ? ((x) + 0x20) : (x))
 
60
+
 
61
 /* Convert a string to a normalized Python string: all characters are
 
62
    converted to lower case, spaces are replaced with underscores. */
 
63
 
 
64
@@ -70,7 +75,7 @@ PyObject *normalizestring(const char *st
 
65
         if (ch == ' ')
 
66
             ch = '-';
 
67
         else
 
68
-            ch = tolower(Py_CHARMASK(ch));
 
69
+            ch = ascii_tolower(Py_CHARMASK(ch));
 
70
        p[i] = ch;
 
71
     }
 
72
     return v;
 
73
--- Lib/email/__init__.py       2008-07-02 18:58:15.000000000 +0300
 
74
+++ Lib/email/__init__.py       2008-07-02 18:59:28.000000000 +0300
 
75
@@ -109,15 +109,18 @@
 
76
     'Text',
 
77
     ]
 
78
 
 
79
+import string
 
80
+lower_map = string.maketrans(string.ascii_uppercase, string.ascii_lowercase)
 
81
+
 
82
 for _name in _LOWERNAMES:
 
83
-    importer = LazyImporter(_name.lower())
 
84
+    importer = LazyImporter(_name.translate(lower_map))
 
85
     sys.modules['email.' + _name] = importer
 
86
     setattr(sys.modules['email'], _name, importer)
 
87
 
 
88
 
 
89
 import email.mime
 
90
 for _name in _MIMENAMES:
 
91
-    importer = LazyImporter('mime.' + _name.lower())
 
92
+    importer = LazyImporter('mime.' + _name.translate(lower_map))
 
93
     sys.modules['email.MIME' + _name] = importer
 
94
     setattr(sys.modules['email'], 'MIME' + _name, importer)
 
95
     setattr(sys.modules['email.mime'], _name, importer)