Skip to content

Location and text of f-string unclosed quote error is incorrect #104658

Description

@pablogsal

Since the PEP 701 changes the error of unclosed triple quited f-string literals is now incorrect:

x = 1 + 1
y = 2 + 2
z = f"""
sdfjnsdfjsdf
sdfsdfs{1+
2}dfigdf {3+
4}sdufsd
""

Executing this file will show:

  File "/Users/pgalindo3/github/python/python_tokenizer_marta/lol.py", line 8
    4}sdufsd
        ^
SyntaxError: unterminated triple-quoted f-string literal (detected at line 13)

both the line number and the text are wrong.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions