[New-bugs-announce] [issue28350] Interning string constants with null character

Serhiy Storchaka report at bugs.python.org
Mon Oct 3 15:23:36 EDT 2016


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 <report at bugs.python.org>
<http://bugs.python.org/issue28350>
_______________________________________


More information about the New-bugs-announce mailing list