Skip to content

Multiline F-strings remove some lines #3700

@ChristianRomberg

Description

@ChristianRomberg

Snakemake version
9.9.0
Python 3.12.2

Describe the bug
Multiline f-strings strip lines that don't contain variables or relevant syntax. See example.
I would expect the example to produce a file that also contains "def", but it doesn't.

Minimal example

rule test:
    output:
        "test.txt"
    run:
        with open(output[0], "w") as f:
            f.write(f"""abc
                def
                {1+1}
            """)

Output (test.txt) of example

abc
                2
            

Note that the second line (containing "def") is missing.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions