Comment 4 for bug 1661766

Revision history for this message
Seth Arnold (seth-arnold) wrote :

By 'regression' I meant 'something that used to work and now doesn't work': e.g.:

$ python2 -c 'import re; re.search("hi", "hi", re.LOCALE)'
$ python3.5 -c 'import re; re.search("hi", "hi", re.LOCALE)'
$ python3.6 -c 'import re; re.search("hi", "hi", re.LOCALE)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.6/re.py", line 182, in search
    return _compile(pattern, flags).search(string)
  File "/usr/lib/python3.6/re.py", line 301, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.6/sre_compile.py", line 562, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.6/sre_parse.py", line 866, in parse
    p.pattern.flags = fix_flags(str, p.pattern.flags)
  File "/usr/lib/python3.6/sre_parse.py", line 833, in fix_flags
    raise ValueError("cannot use LOCALE flag with a str pattern")
ValueError: cannot use LOCALE flag with a str pattern

The error message sure makes it look like an intentional API break. :(

Thanks