[proxy] github.com← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

[3.6] bpo-31672: Fix string.Template accidentally matched non-ASCII identifiers (GH-3872) by methane · Pull Request #3982 · python/cpython

the-knights-who-say-ni

…dentifiers (pythonGH-3872)

Pattern `[a-z]` with `IGNORECASE` flag can match to some non-ASCII characters.

Straightforward solution for this is using `IGNORECASE | ASCII` flag.
But users may subclass `Template` and override only `idpattern`. So we want to
avoid changing `Template.flags`.

So this commit uses local flag `-i` for `idpattern` and change `[a-z]` to `[a-zA-Z]`..
(cherry picked from commit b22273e)

Merged

methane deleted the backport-b22273e-3.6 branch

October 14, 2017 05:22

methane added a commit to methane/cpython that referenced this pull request

Oct 14, 2017

Merged

methane added a commit that referenced this pull request

Oct 14, 2017
This sentence is removed while backporting to 3.6 branch.
See #3982 (comment)