Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
number of tests, all because of the codecs/_multibytecodecs issue described
here (it's not a Py3K issue, just something Py3K discovers):
http://mail.python.org/pipermail/python-dev/2006-April/064051.html
Hye-Shik Chang promised to look for a fix, so no need to fix it here. The
tests that are expected to break are:
test_codecencodings_cn
test_codecencodings_hk
test_codecencodings_jp
test_codecencodings_kr
test_codecencodings_tw
test_codecs
test_multibytecodec
This merge fixes an actual test failure (test_weakref) in this branch,
though, so I believe merging is the right thing to do anyway.
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 9eda653..297611c 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -446,7 +446,7 @@
return PyString_FromString(decomp);
}
-void
+static void
get_decomp_record(PyObject *self, Py_UCS4 code, int *index, int *prefix, int *count)
{
if (code >= 0x110000) {
@@ -486,8 +486,8 @@
Py_UNICODE *i, *end, *o;
/* Longest decomposition in Unicode 3.2: U+FDFA */
Py_UNICODE stack[20];
- int space, stackptr, isize;
- int index, prefix, count;
+ Py_ssize_t space, isize;
+ int index, prefix, count, stackptr;
unsigned char prev, cur;
stackptr = 0;
@@ -508,7 +508,7 @@
/* Hangul Decomposition adds three characters in
a single step, so we need atleast that much room. */
if (space < 3) {
- int newsize = PyString_GET_SIZE(result) + 10;
+ Py_ssize_t newsize = PyString_GET_SIZE(result) + 10;
space += 10;
if (PyUnicode_Resize(&result, newsize) == -1)
return NULL;
@@ -759,7 +759,7 @@
unsigned long h = 0;
unsigned long ix;
for (i = 0; i < len; i++) {
- h = (h * scale) + (unsigned char) toupper(s[i]);
+ h = (h * scale) + (unsigned char) toupper(Py_CHARMASK(s[i]));
ix = h & 0xff000000;
if (ix)
h = (h ^ ((ix>>24) & 0xff)) & 0x00ffffff;
@@ -906,7 +906,7 @@
if (!_getucname(self, code, buffer, sizeof(buffer)))
return 0;
for (i = 0; i < namelen; i++) {
- if (toupper(name[i]) != buffer[i])
+ if (toupper(Py_CHARMASK(name[i])) != buffer[i])
return 0;
}
return buffer[namelen] == '\0';