From: Victor Stinner Date: Tue, 29 May 2012 10:30:29 +0000 (+0200) Subject: PyArg_Parse*("U"): ensure that the Unicode string is ready X-Git-Tag: v3.3.0a4~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a1b0c9fc4d68cd4e1103456d0cedf2ef3bbbfe9a;p=python PyArg_Parse*("U"): ensure that the Unicode string is ready --- diff --git a/Python/getargs.c b/Python/getargs.c index 17c4ee5955..9f72fa4ebf 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -1167,8 +1167,11 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, case 'U': { /* PyUnicode object */ PyObject **p = va_arg(*p_va, PyObject **); - if (PyUnicode_Check(arg)) + if (PyUnicode_Check(arg)) { + if (PyUnicode_READY(arg) == -1) + RETURN_ERR_OCCURRED; *p = arg; + } else return converterr("str", arg, msgbuf, bufsize); break;