Skip to content

Ruff fails to detect python 3.10 unterminated string literal syntax error #24348

@fynnsu

Description

@fynnsu

Summary

Repro:

# file: py310.py
def contains_syntax_error():
    out = ";".join(
        f"{name}={
            ','.join(['1', '2'])
        }"
        for name, p in {"name": "p"}
    )
    print(out)
❯ python py310.py
  File "/Users/fschmitt/tmp/py310.py", line 4
    f"{name}={
    ^
SyntaxError: unterminated string literal (detected at line 4)
❯ ruff check py310.py --target-version py310
All checks passed!

Note: this is a syntax error on python 3.10 but allowed in newer versions (3.13 tested and passed).

Version

ruff 0.15.8 (c2a8815 2026-03-26)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingparserRelated to the parser

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions