Message362264
On different platforms and versions the following expression has different results:
python -c 'import re; print(re.compile("(.*)", 0).sub("a\\1", "bc"))'
As far is I observed:
Linux/Python 3.6.9 => abc
MacOS/Python 3.7.1 => abca
Repl.it/Python 3.8.1 => abca
MacOS/Python 2.7.17 => abc
Linux/Python 2.7.17 => abc
According the the documentation I would guess that "abc" is the correct return value.
The issues also occurs without compiling or capture group:
re.sub(".*", "a", "cb") a vs aa |
|
Date |
User |
Action |
Args |
2020-02-19 11:40:24 | slomo | set | recipients:
+ slomo, ezio.melotti, mrabarnett |
2020-02-19 11:40:24 | slomo | set | messageid: <1582112424.4.0.996005066696.issue39687@roundup.psfhosted.org> |
2020-02-19 11:40:24 | slomo | link | issue39687 messages |
2020-02-19 11:40:24 | slomo | create | |
|