Skip to content

Failure in f-string interpretation #125086

@ullix

Description

@ullix

Bug report

Bug description:

Quotes inside a function should not be considered to be part of an f-string!

# python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on Linux Mint 21.2

>>> info="abcdefg"
>>> print(f"TEST: {info.replace("\n", " ")}")
  File "<stdin>", line 1
    print(f"TEST: {info.replace("\n", " ")}")
                                  ^
SyntaxError: unexpected character after line continuation character

CPython versions tested on:

3.10

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions