-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
InteractiveInterpreter.runsource()
is supposed to return True when the input is incomplete, as per the doc: https://docs.python.org/3/library/code.html#code.InteractiveInterpreter.runsource. This appears to have regressed with f-strings in Python 3.12+
Python 3.11.2:
>>> code.InteractiveInterpreter().runsource('a = f"""')
True
Python 3.12.1 or Python 3.13.0a2+ (heads/main:1ae7ceba29, Jan 4 2024, 16:18:49):
>>> code.InteractiveInterpreter().runsource('a = f"""')
File "<input>", line 1
a = f"""
^
SyntaxError: unterminated triple-quoted f-string literal (detected at line 1)
False
CPython versions tested on:
3.11, 3.12, 3.13
Operating systems tested on:
Linux
Linked PRs
davidmerwin, tusharsadhwani and absop
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error