Commits

Victor Stinner  committed 1700fb2

PyArg_Parse*("U"): ensure that the Unicode string is ready

  • Participants
  • Parent commits b31ea79

Comments (0)

Files changed (1)

File Python/getargs.c

 
     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;