[issue38964] Output of syntax error in f-string contains wrong filename

2020-05-25 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue38964] Output of syntax error in f-string contains wrong filename

2020-05-25 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 791a46ed58f74d673cf2c0d81deec57155bf7583 by Lysandros Nikolaou in branch '3.9': [3.9] bpo-38964: Print correct filename on a SyntaxError in an fstring (GH-20399) (GH-20404) https://github.com/python/cpython/commit/791a46ed58f74d673cf2c0d

[issue38964] Output of syntax error in f-string contains wrong filename

2020-05-25 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- pull_requests: +19666 pull_request: https://github.com/python/cpython/pull/20404 ___ Python tracker ___ __

[issue38964] Output of syntax error in f-string contains wrong filename

2020-05-25 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset f7b1e461567e5e3fa3ba46f589d9edc1b45b2dd0 by Lysandros Nikolaou in branch 'master': bpo-38964: Print correct filename on a SyntaxError in an fstring (GH-20399) https://github.com/python/cpython/commit/f7b1e461567e5e3fa3ba46f589d9edc1b45b2d

[issue38964] Output of syntax error in f-string contains wrong filename

2020-05-25 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- versions: +Python 3.10 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue38964] Output of syntax error in f-string contains wrong filename

2020-05-25 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- keywords: +patch nosy: +lys.nikolaou nosy_count: 4.0 -> 5.0 pull_requests: +19662 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20399 ___ Python tracker

[issue38964] Output of syntax error in f-string contains wrong filename

2019-12-04 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, moving f-strings to the grammar would be a huge change, and not just for CPython. I discussed it at the last PyCon with the authors of various editors (for syntax highlighting) and other tools that parse python code. No one was hugely opposed to it, and

[issue38964] Output of syntax error in f-string contains wrong filename

2019-12-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Additionally, the idea of moving f-strings into the Python grammar would also > fix this problem. That might be a better way forward, although it has a > number of downsides, too. For considerin this path we would need to wait to see first the futur

[issue38964] Output of syntax error in f-string contains wrong filename

2019-12-04 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that although the PEP says that's how it behaves, that shouldn't be prescriptive of the error message. Clearly we can be more helpful here. I have a large, elaborate re-write of the error generating code that I've been working on, on and off for over

[issue38964] Output of syntax error in f-string contains wrong filename

2019-12-04 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith stage: resolved -> ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue38964] Output of syntax error in f-string contains wrong filename

2019-12-04 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: fixed -> status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailin

[issue38964] Output of syntax error in f-string contains wrong filename

2019-12-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Although Batuhan is correct maybe we can consider trying to improve the debugging experience off-strings due to the fact that these errors in a big project may be difficult to find. Although you have always the back-trace on the other side. -

[issue38964] Output of syntax error in f-string contains wrong filename

2019-12-04 Thread Batuhan
Batuhan added the comment: This is actually specified behavior in PEP 498 https://www.python.org/dev/peps/pep-0498/#expression-evaluation > Expressions are parsed with the equivalent of ast.parse('(' + expression + > ')', '', 'eval') -- nosy: +BTaskaya

[issue38964] Output of syntax error in f-string contains wrong filename

2019-12-04 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue38964] Output of syntax error in f-string contains wrong filename

2019-12-04 Thread Erik Cederstrand
Erik Cederstrand added the comment: Additionally, the output in the 2nd example does not contain the helpful text printing the context and location of the code containing the syntax error. -- ___ Python tracker

[issue38964] Output of syntax error in f-string contains wrong filename

2019-12-04 Thread Erik Cederstrand
New submission from Erik Cederstrand : When I have a normal syntax error in a file, Python reports the filename in the exception output: $ cat syntax_error.py 0x=5 $ python3.8 syntax_error.py File "syntax_error.py", line 1 0x=5 ^ SyntaxError: invalid hexadecimal literal But if