this was noticed in pyflakes's testsuite: https://github.com/PyCQA/pyflakes/pull/532#pullrequestreview-396059622
I've created a small script to reproduce the problem
```
import sys
SRC = b"""\
def foo():
'''
def bar():
pass
def baz():
'''quux'''
"""
try:
exec(SRC)
except SyntaxError as e:
print(
f'{sys.version}\n\n'
f'{type(e).__name__}:\n'
f'- line: {e.lineno}\n'
f'- offset: {e.offset}\n'
f'- text: {e.text!r}\n'
)
```
This was "fixed" in python3.8, but has regressed:
```
$ python3.6 t2.py
3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0]
SyntaxError:
- line: 8
- offset: 52
- text: " '''\n\ndef bar():\n pass\n\ndef baz():\n '''quux'''\n"
$ python3.8 t2.py
3.8.2 (default, Feb 26 2020, 02:56:10)
[GCC 7.4.0]
SyntaxError:
- line: 8
- offset: 8
- text: " '''\n\ndef bar():\n pass\n\ndef baz():\n '''quux'''\n"
$ ./python t2.py
3.9.0a5+ (heads/master:3955da8568, Apr 19 2020, 14:29:48)
[GCC 7.5.0]
SyntaxError:
- line: 8
- offset: 52
- text: " '''\n\ndef bar():\n pass\n\ndef baz():\n '''quux'''\n"
``` |