[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-29 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Thanks, Victor!

The fix is merged, so I'm closing this again.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-29 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 990efe0fff749773887a50cb1ecb2c5d09263cf8 by Lysandros Nikolaou in 
branch '3.9':
[3.9] bpo-41084: Fix test_fstring failure when using the old parser (GH-21212)
https://github.com/python/cpython/commit/990efe0fff749773887a50cb1ecb2c5d09263cf8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-29 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +20366
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/21212

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-29 Thread STINNER Victor


STINNER Victor  added the comment:

The change broke the old parser in Python 3.9, I reopen the issue:

AMD64 Arch Linux VintageParser 3.9:
https://buildbot.python.org/all/#/builders/765/builds/129

FAIL: test_format_specifier_expressions (test.test_fstring.TestCase) 
(str="f'{4:{/5}}'")
FAIL: test_invalid_syntax_error_message (test.test_fstring.TestCase)
FAIL: test_lambda (test.test_fstring.TestCase) (str="f'{lambda x:x}'")
FAIL: test_parens_in_expressions (test.test_fstring.TestCase) (str="f'{,}'")
FAIL: test_parens_in_expressions (test.test_fstring.TestCase) (str="f'{,}'")

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-27 Thread miss-islington


miss-islington  added the comment:


New changeset cb0dc52d37a5cc561ad39bc034afe7db9c461768 by Miss Islington (bot) 
in branch '3.9':
bpo-41084: Adjust message when an f-string expression causes a SyntaxError 
(GH-21084)
https://github.com/python/cpython/commit/cb0dc52d37a5cc561ad39bc034afe7db9c461768


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-27 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +20342
pull_request: https://github.com/python/cpython/pull/21188

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

AFAIK, we don't guarantee the stability of error messages, so I think 
backporting is fine. It's all the better that this is just prefixing something 
to an existing error message.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I would say yes unless someone sees an obvious impediment

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-27 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Should we maybe backport this to 3.9 as well?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-26 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 2e0a920e9eb540654c0bb2298143b00637dc5961 by Lysandros Nikolaou in 
branch 'master':
bpo-41084: Adjust message when an f-string expression causes a SyntaxError 
(GH-21084)
https://github.com/python/cpython/commit/2e0a920e9eb540654c0bb2298143b00637dc5961


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-23 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
keywords: +patch
pull_requests: +20250
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21084

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-23 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

> My only reservation would be: if the parsing of f-strings is moved into the 
> parser, would it be possible to maintain the error new messages?

Probably without a single change.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think it's a good idea.

My only reservation would be: if the parsing of f-strings is moved into the 
parser, would it be possible to maintain the error new messages?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-22 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

It's relatively easy to identify if a SyntaxError occurs when parsing an 
fstring expression or not. The idea is to slightly change the error message to 
start with "f-string: " when it does (in the same way in which SyntaxError 
messages are produced by the hand-written fstring parser). I have a working PR 
that produces the following:

$ cat a.py
f'{a $ b}'
$ ./python.exe a.py
  File "/Users/lysnikolaou/Repositories/cpython/a.py", line 1
(a $ b)
   ^
SyntaxError: f-string: invalid syntax

Thoughts?

--
components: Interpreter Core
messages: 372134
nosy: eric.smith, gvanrossum, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Signify that a SyntaxError comes from an fstring in the error message
type: enhancement
versions: Python 3.10, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com