diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-02 17:00:15 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-02 17:00:15 (GMT) |
commit | 1a15aba71d45a6ad38ee535611aa7eaf23de2e3e (patch) | |
tree | a706237a20f5c21e102f4d89278b47d5d7e35e4e /Python | |
parent | 0069be19e5bbe8d485d4606bc1f548bf103b8a79 (diff) | |
download | cpython-1a15aba71d45a6ad38ee535611aa7eaf23de2e3e.zip cpython-1a15aba71d45a6ad38ee535611aa7eaf23de2e3e.tar.gz cpython-1a15aba71d45a6ad38ee535611aa7eaf23de2e3e.tar.bz2 |
PyCodec_ReplaceErrors() uses "C" format instead of "u#" to build result
Diffstat (limited to 'Python')
-rw-r--r-- | Python/codecs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/codecs.c b/Python/codecs.c index 4c2fc5d..0008bdc 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -534,10 +534,11 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc) return Py_BuildValue("(Nn)", res, end); } else if (PyObject_IsInstance(exc, PyExc_UnicodeDecodeError)) { - Py_UNICODE res = Py_UNICODE_REPLACEMENT_CHARACTER; if (PyUnicodeDecodeError_GetEnd(exc, &end)) return NULL; - return Py_BuildValue("(u#n)", &res, 1, end); + return Py_BuildValue("(Cn)", + (int)Py_UNICODE_REPLACEMENT_CHARACTER, + end); } else if (PyObject_IsInstance(exc, PyExc_UnicodeTranslateError)) { PyObject *res; |