From a1b0c9fc4d68cd4e1103456d0cedf2ef3bbbfe9a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 29 May 2012 12:30:29 +0200 Subject: [PATCH] PyArg_Parse*("U"): ensure that the Unicode string is ready --- Python/getargs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.40.0