Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested quotation marks in f-string, ignores parse error #11221

Closed
andy-lz opened this issue Apr 30, 2024 · 1 comment
Closed

Nested quotation marks in f-string, ignores parse error #11221

andy-lz opened this issue Apr 30, 2024 · 1 comment
Labels
parser Related to the parser

Comments

@andy-lz
Copy link

andy-lz commented Apr 30, 2024

In Python 3.9.18, the below code will succeed silently with ruff format and ruff check, even though it has a SyntaxError:

# file.py
my_str = f"1+1={"2"}"


>> ruff format file.py #succeeds
>> python file.py  # fails with SyntaxError
@AlexWaygood AlexWaygood added the parser Related to the parser label Apr 30, 2024
@AlexWaygood
Copy link
Member

Thanks for opening the issue! I'm going to close this as a duplicate of #6591 (the syntax in question here is legal on Python 3.12+, but not on lower versions)

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Related to the parser
Projects
None yet
Development

No branches or pull requests

2 participants