New submission from Adam Williamson <[email protected]>:
While debugging issues with the black test suite in Python 3.9, I found one
which black upstream says is a Cpython issue, so I'm filing it here.
Reproduction is very easy. Just use this four-line tester:
print("hello, world")
\
print("hello, world 2")
with that saved as `test.py`, check the results:
<mock-chroot> sh-5.0# PYTHONOLDPARSER=1 python3 test.py
hello, world
hello, world 2
<mock-chroot> sh-5.0# python3 test.py
File "/builddir/build/BUILD/black-19.10b0/test.py", line 3
^
SyntaxError: invalid syntax
The reason black has this test (well, a similar test - in black's test, the
file *starts* with the backslash then the empty line, but the result is the
same) is covered in https://github.com/psf/black/issues/922 and
https://github.com/psf/black/pull/948 .
----------
components: Interpreter Core
messages: 370618
nosy: adamwill
priority: normal
severity: normal
status: open
title: New parser considers empty line following a backslash to be a syntax
error, old parser didn't
type: behavior
versions: Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com