New submission from STINNER Victor <victor.stin...@haypocalc.com>: The curses module (only since Python 3.3), locale.strcoll(), locale.strxfrm(), time.strftime() and imp.NullImporter() (only on Windows) accept embedded null characters, whereas they convert the Unicode string to a wide character (wchar_t*) string.
The problem is that the null character truncates the string. Example: >>> locale.strxfrm('a') 'a' >>> locale.strxfrm('a\0b') 'a' Attached patch fixes these functions. I wrote the patch for Python 3.3. ---------- components: Library (Lib), Unicode files: embedded_nul.patch keywords: patch messages: 149656 nosy: ezio.melotti, haypo priority: normal severity: normal status: open title: Reject embedded null characters in wchar* strings versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23984/embedded_nul.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13617> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com