[Python-checkins] cpython: _PyUnicode_Ready() for 16-bit wchar_t

victor.stinner python-checkins at python.org
Mon Oct 3 04:17:49 CEST 2011


http://hg.python.org/cpython/rev/8720e6fa6fc5
changeset:   72607:8720e6fa6fc5
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Mon Oct 03 04:17:10 2011 +0200
summary:
  _PyUnicode_Ready() for 16-bit wchar_t

files:
  Objects/unicodeobject.c |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1121,6 +1121,8 @@
         _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;

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list