New submission from Serhiy Storchaka: Currently string constants are interned if they consist of ASCII word characters ([0-9A-Za-z_]). But strings are tested only to the first null character. This is not problem for names, since they can't include null characters, but string constants that contains ASCII non-word characters after the null character passes this test.
Proposed simple patch fixes the testing function all_name_chars(). Other question: shouldn't PyUnicode_IsIdentifier() be used in 3.x? ---------- components: Interpreter Core files: all_name_chars.patch keywords: patch messages: 277994 nosy: benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, rhettinger, serhiy.storchaka, yselivanov priority: normal severity: normal stage: patch review status: open title: Interning string constants with null character type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file44945/all_name_chars.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28350> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com