]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
_PyUnicode_Ready() for 16-bit wchar_t
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 3 Oct 2011 02:17:10 +0000 (04:17 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 3 Oct 2011 02:17:10 +0000 (04:17 +0200)
Objects/unicodeobject.c

index 4a7815394eb176082df8e7ebb87509deb04f1f24..9c02817b9da4ff8cc89912799f6fd2e54f24716c 100644 (file)
@@ -1121,6 +1121,8 @@ _PyUnicode_Ready(PyObject *obj)
         _PyUnicode_STATE(unicode).kind = PyUnicode_4BYTE_KIND;
         _PyUnicode_UTF8(unicode) = NULL;
         _PyUnicode_UTF8_LENGTH(unicode) = 0;
+        /* unicode_convert_wchar_to_ucs4() requires a ready string */
+        _PyUnicode_STATE(unicode).ready = 1;
         unicode_convert_wchar_to_ucs4(_PyUnicode_WSTR(unicode), end, unicode);
         PyObject_FREE(_PyUnicode_WSTR(unicode));
         _PyUnicode_WSTR(unicode) = NULL;