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

bpo-40176: Improve error messages for unclosed string literals #19346

Merged
merged 5 commits into from Jan 20, 2021

Conversation

@isidentical
Copy link
Member

@isidentical isidentical commented Apr 3, 2020

https://bugs.python.org/issue40176

Automerge-Triggered-By: GH:isidentical

@ammaraskar
Copy link
Member

@ammaraskar ammaraskar commented Apr 3, 2020

This message is still a bit jargon-y, I think Rust's error message in this case is pretty nice:

error: unterminated double quote string
 --> src/main.rs:2:19
  |
2 |       let message = "Hello world
  |  ___________________^
3 | |     println!(message);
4 | | }
  | |_^
@ammaraskar ammaraskar requested a review from benjaminp Apr 3, 2020
@isidentical isidentical force-pushed the isidentical:bpo-40176 branch from 9294171 to 50f6de2 Apr 3, 2020
@isidentical
Copy link
Member Author

@isidentical isidentical commented Apr 3, 2020

This message is still a bit jargon-y, I think Rust's error message in this case is pretty nice:

That definitely looks more simpler to those who unfamiliar with parser jargon. I'm not sure if we should still use EOF/EOL when needed or not though.

@isidentical isidentical force-pushed the isidentical:bpo-40176 branch 4 times, most recently from c75e26e to 0b6386d Apr 3, 2020
@isidentical isidentical requested a review from serhiy-storchaka Apr 4, 2020
@isidentical isidentical force-pushed the isidentical:bpo-40176 branch from c7b3048 to 4c24faa Jan 20, 2021
@isidentical isidentical force-pushed the isidentical:bpo-40176 branch from 4c24faa to fcecf4b Jan 20, 2021
@cfbolz
Copy link
Contributor

@cfbolz cfbolz commented Jan 20, 2021

as a data point my (non-cs) students always get confused by the EOF and EOL abbreviation. PyPy's message is:
end of file (EOF) while scanning triple-quoted string literal

@isidentical
Copy link
Member Author

@isidentical isidentical commented Jan 20, 2021

we actually don't use EOF/EOL anymore, just "unterminated string literal"

@cfbolz
Copy link
Contributor

@cfbolz cfbolz commented Jan 20, 2021

ah great (sorry, hadn't read the diff yet, just saw the earlier comment)

Copy link
Member

@pablogsal pablogsal left a comment

LGTM

Feel free to land once you address the minor comment

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jan 20, 2021

@isidentical: Status check is done, and it's a success .

@miss-islington miss-islington merged commit a698d52 into python:master Jan 20, 2021
11 checks passed
11 checks passed
Docs
Details
Check for source changes
Details
Check if generated files are up to date
Details
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20210120.60 succeeded
Details
Travis CI - Pull Request Build Passed
Details
bedevere/issue-number Issue number 40176 found
Details
bedevere/news News entry found in Misc/NEWS.d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants