Skip to content
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

E703: Incorrect detection and replacement of semicolon #4828

Closed
Tracked by #4972
addisoncrump opened this issue Jun 3, 2023 · 0 comments · Fixed by #5199
Closed
Tracked by #4972

E703: Incorrect detection and replacement of semicolon #4828

addisoncrump opened this issue Jun 3, 2023 · 0 comments · Fixed by #5199
Assignees
Labels
bug Something isn't working

Comments

@addisoncrump
Copy link
Contributor

addisoncrump commented Jun 3, 2023

Okay, I'll be the first to say it, but this bug is really not that important. I'm reporting it primarily because it implies that there may be other issues with semicolon/newline processing in other situations I haven't observed yet.

The following snippet is a valid Python script (no trailing newline):

0\
;

Ruff attempts to correct it to the following (with trailing newline, but it's escaped):

0\

As a result, there is an EOF syntax error. This only applies to a situation where a) there is a semicolon at the end of the input (no trailing newline), and b) the line before is escaped.

Discovered with #4822.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants