[issue44369] Improve syntax error for wrongly closed strings

2021-06-14 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: One problem with that is that the lookahead will move the error indicator to some incorrect place if the match fails. For example: PYTHON3.9 >>> "dfssdfsdfsd" fdsf sdfsdfsd {} File "", line 1 "dfssdfsdfsd" fdsf sdfsdfsd {} ^ Sy

[issue44369] Improve syntax error for wrongly closed strings

2021-06-12 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: >From what I can share by my experience, this error happens soo much. So I'd >love to see it. For a more consistent message with others, maybe it could be something like this; SyntaxError: invalid syntax. Maybe you meant to use a different type of quote

[issue44369] Improve syntax error for wrongly closed strings

2021-06-09 Thread Andre Roberge
Andre Roberge added the comment: I like this. While it would be a bit longer, I'm wondering if the message should not read instead as follows: ... Did you use the same quotes here as those enclosing the string? === I suspect that errors coming from the use of a single quote, as in: 'Don't

[issue44369] Improve syntax error for wrongly closed strings

2021-06-09 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +25219 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26633 ___ Python tracker __

[issue44369] Improve syntax error for wrongly closed strings

2021-06-09 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : Let's asume this string: " x = "Cannot recover from "MemoryErrors" while something happnes while " The line is incorrect because the quotes arround MemoryErrors are the same as the string is used, resulting in STRING + expression + STRING. Currenly