This fixed (should fix) the failure in test_backslashes_in_string_part
in test_fstring
.
Currently, it seems this is even causing undefined behavior, reading some memory somewhere that should not be read. If you try f'\{42}'
in Python 3.6, PyPy 7.3.0, this comes out:
>>>> f'\{42}'
'\\\x0042'
>>>> f'\{42}'
'\\c42'
>>>> f'\{42}'
'\\\x9c42'
>>>> f'\{42}'
'\\\x0042'
>>>> f'\{42}'
'\\ì42'
>>>> f'\{42}'
'\x0b42'
>>>> f'\{42}'
'\\\x8242'
>>>> f'\{42}'
'\\\x0042'
>>>> f'\{42}'
'\\\x1742'
See https://bugs.python.org/issue29104 & https://github.com/python/cpython/pull/490 (& https://github.com/python/cpython/pull/1812, backported to 3.6)