STINNER Victor added the comment: It looks like PyUnicode_FromUnicode() should accept invalid UTF-16 surrogates because the array module indirectly relies on that:
On Windows (16-bit wchar_t/Py_UNICODE), len(array.array('u', '\U0010ffff')) is 2 and array.array('u', '\U0010ffff')[0] is '\udbff' (lone surrogate). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17223> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com