Blame python-2.5.1-codec-ascii-tolower.patch

c217786
diff -up Python-2.6.6/Python/codecs.c.ascii-tolower Python-2.6.6/Python/codecs.c
c217786
--- Python-2.6.6/Python/codecs.c.ascii-tolower	2010-05-09 11:15:40.000000000 -0400
c217786
+++ Python-2.6.6/Python/codecs.c	2010-11-29 15:06:20.191352174 -0500
c217786
@@ -45,6 +45,11 @@ int PyCodec_Register(PyObject *search_fu
c217786
     return -1;
c217786
 }
c217786
 
c217786
+/* isupper() forced into the ASCII Locale */
c217786
+#define ascii_isupper(x) (((x) >= 0x41) && ((x) <= 0x5A))
c217786
+/* tolower() forced into the ASCII Locale */
c217786
+#define ascii_tolower(x) (ascii_isupper(x) ? ((x) + 0x20) : (x))
c217786
+
c217786
 /* Convert a string to a normalized Python string: all characters are
c217786
    converted to lower case, spaces are replaced with underscores. */
c217786
 
c217786
@@ -70,7 +75,7 @@ PyObject *normalizestring(const char *st
c217786
         if (ch == ' ')
c217786
             ch = '-';
c217786
         else
c217786
-            ch = tolower(Py_CHARMASK(ch));
c217786
+            ch = ascii_tolower(Py_CHARMASK(ch));
c217786
         p[i] = ch;
c217786
     }
c217786
     return v;