This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tjollans
Recipients tjollans
Date 2017-10-03.06:02:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507010548.18.0.213398074469.issue31669@psf.upfronthosting.co.za>
In-reply-to
Content
string.Template matches a $identifier with the regex [_a-z][_a-z0-9]* and re.IGNORECASE. This matches S, ſ and s, but not ß. https://github.com/python/cpython/blob/master/Lib/string.py#L78 (this code came up on python-dev)

The docs specify "any case-insensitive ASCII alphanumeric string (including underscores) that starts with an underscore or ASCII letter.". This includes S and s, but neither ſ nor ß. https://docs.python.org/3/library/string.html#template-strings

The docs refer to PEP 292, which specifies "By default, 'identifier' must spell a Python identifier [...]" This includes S, ſ, s and ß. https://www.python.org/dev/peps/pep-0292/

It's not entirely clear what the correct behaviour is (probably accepting any Python identifier). In any case, the current behaviour of string.Template is a bit silly, but changing it might break stuff.
History
Date User Action Args
2017-10-03 06:02:28tjollanssetrecipients: + tjollans
2017-10-03 06:02:28tjollanssetmessageid: <1507010548.18.0.213398074469.issue31669@psf.upfronthosting.co.za>
2017-10-03 06:02:28tjollanslinkissue31669 messages
2017-10-03 06:02:27tjollanscreate