[issue46275] caret location for syntax error pointing with f-strings

William Navaraj report at bugs.python.org
Wed Jan 5 20:52:28 EST 2022


William Navaraj <williamnavaraj at gmail.com> added the comment:

A potential solution or in that direction

https://github.com/williamnavaraj/cpython/tree/fix-issue-46275

Example 1:

```
temp=f"blank {foo)" 

```
    temp=f"blank {foo)" 
                     ^
SyntaxError: f-string: unmatched ')'


Example 2:

```
temp=f"blank ({foo)foo2" 

```
    temp=f"blank ({foo)foo2" 
                      ^
SyntaxError: f-string: unmatched ')'


Example 3:

```
temp=f"blank ({foo)blank ({foo()}) blank foo()})"

```
    temp=f"blank ({foo)blank ({foo()}) blank foo()})"
                     ^
SyntaxError: f-string: unmatched ')'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46275>
_______________________________________


More information about the Python-bugs-list mailing list