Skip to content

Conversation

@lysnikolaou
Copy link
Member

@lysnikolaou lysnikolaou commented Jun 15, 2020

When a file ends with a line that contains a line continuation character
the text of the emitted SyntaxError is empty, contrary to the old
parser, where the error text contained the text of the last line.

https://bugs.python.org/issue40985

When a file ends with a line that contains a line continuation character the text of the emitted SyntaxError is empty, contrary to the old parser, where the error text contained the text of the last line.
@lysnikolaou
Copy link
Member Author

Reopening for the CI to re-run.

@lysnikolaou lysnikolaou reopened this Jun 15, 2020
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, brilliant fix -- looks like the original code meant to break out of the outer loop. :-)

…85.IIN_xX.rst Co-authored-by: Guido van Rossum <guido@python.org>
@pablogsal pablogsal merged commit 113e2b0 into python:master Jun 16, 2020
@miss-islington
Copy link
Contributor

Thanks @lysnikolaou for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 16, 2020
pythonGH-20888) When a file ends with a line that contains a line continuation character the text of the emitted SyntaxError is empty, contrary to the old parser, where the error text contained the text of the last line. (cherry picked from commit 113e2b0) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
@bedevere-bot
Copy link

GH-20905 is a backport of this pull request to the 3.9 branch.

@lysnikolaou lysnikolaou deleted the linecont-lastline branch June 16, 2020 00:29
miss-islington added a commit that referenced this pull request Jun 16, 2020
GH-20888) When a file ends with a line that contains a line continuation character the text of the emitted SyntaxError is empty, contrary to the old parser, where the error text contained the text of the last line. (cherry picked from commit 113e2b0) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants