• INADA Naoki's avatar
    bpo-31672: Fix string.Template accidentally matched non-ASCII identifiers (GH-3872) · 7060380d
    INADA Naoki yazdı
    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 b22273ec)
    7060380d
test_string.py 18.1 KB