bpo-40847: Consider a line with only a LINECONT a blank line#20769
Merged
pablogsal merged 5 commits intopython:masterfrom Jun 10, 2020
Merged
bpo-40847: Consider a line with only a LINECONT a blank line#20769pablogsal merged 5 commits intopython:masterfrom
pablogsal merged 5 commits intopython:masterfrom
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`.
Member
Author
|
Should we also backport this to the other bug-fix branches? |
Member
|
Only to 3.9. Who knows what else it breaks... |
pablogsal
reviewed
Jun 10, 2020
Misc/NEWS.d/next/Core and Builtins/2020-06-09-23-52-32.bpo-40847.4XAACw.rst
Outdated
Show resolved
Hide resolved
Member
Author
|
@pablogsal I didn't like the blurb text before, so I changed it up a bit. Could you review it once more, please? |
pablogsal
reviewed
Jun 10, 2020
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 <Pablogsal@gmail.com>
Contributor
|
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. |
miss-islington
added a commit
that referenced
this pull request
Jun 11, 2020
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 <Pablogsal@gmail.com> (cherry picked from commit 896f4cf) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
SyntaxErrorfor valid input. For example,an empty line following a line continuation character was interpreted
as a
SyntaxError.https://bugs.python.org/issue40847