-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-40847: Consider a line with only a LINECONT a blank line #20769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
A line with only a line continuation character should be considered a blank line at tokenizer level, so that only a single NEWLINE token gets emitted. The old parser was working around the issue, but the new parser threw a `SyntaxError` for valid input. For example, an empty line following a line continuation character was interpreted as a `SyntaxError`.
Should we also backport this to the other bug-fix branches? |
Only to 3.9. Who knows what else it breaks... |
Misc/NEWS.d/next/Core and Builtins/2020-06-09-23-52-32.bpo-40847.4XAACw.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@pablogsal I didn't like the blurb text before, so I changed it up a bit. Could you review it once more, please? |
Misc/NEWS.d/next/Core and Builtins/2020-06-09-23-52-32.bpo-40847.4XAACw.rst
Outdated
Show resolved
Hide resolved
…47.4XAACw.rst Co-authored-by: Pablo Galindo <[email protected]>
Thanks @lysnikolaou for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
GH-20795 is a backport of this pull request to the 3.9 branch. |
A line with only a line continuation character should be considered a blank line at tokenizer level so that only a single NEWLINE token gets emitted. The old parser was working around the issue, but the new parser threw a `SyntaxError` for valid input. For example, an empty line following a line continuation character was interpreted as a `SyntaxError`. Co-authored-by: Pablo Galindo <[email protected]> (cherry picked from commit 896f4cf) Co-authored-by: Lysandros Nikolaou <[email protected]>
…H-20769) A line with only a line continuation character should be considered a blank line at tokenizer level so that only a single NEWLINE token gets emitted. The old parser was working around the issue, but the new parser threw a `SyntaxError` for valid input. For example, an empty line following a line continuation character was interpreted as a `SyntaxError`. Co-authored-by: Pablo Galindo <[email protected]>
A line with only a line continuation character should be considered
a blank line at tokenizer level, so that only a single NEWLINE token
gets emitted. The old parser was working around the issue, but the
new parser threw a
SyntaxError
for valid input. For example,an empty line following a line continuation character was interpreted
as a
SyntaxError
.https://bugs.python.org/issue40847