diff -rup Python-2.3.4-orig/Modules/_localemodule.c Python-2.3.4/Modules/_localemodule.c --- Python-2.3.4-orig/Modules/_localemodule.c 2004-03-21 14:53:59.000000000 -0500 +++ Python-2.3.4/Modules/_localemodule.c 2007-11-20 09:07:04.000000000 -0500 @@ -399,7 +399,7 @@ PyLocale_strxfrm(PyObject* self, PyObjec buf = PyMem_Malloc(n1); if (!buf) return PyErr_NoMemory(); - n2 = strxfrm(buf, s, n1); + n2 = strxfrm(buf, s, n1) + 1; if (n2 > n1) { /* more space needed */ buf = PyMem_Realloc(buf, n2);