Skip to content

experimental string processing crash on very long variable name #2313

@JelleZijlstra

Description

@JelleZijlstra

On main with --experimental-string-processing:

% cat espcrash.py 
xxxxxx_xxx_xxxx_xx_xxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxxxx_xxxx_xxxx_xxxxx = xxxx.xxxxxx.xxxxxxxxx.xxxxxxxxxxxxxxxxxxxx(
    xx_xxxxxx={
        "x3_xxxxxxxx": f"{x3_xxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxxxx_xxxxxxxx_xxxxxx}_xxxxxxx",
    },
)
% black --experimental-string-processing espcrash.py         
error: cannot format espcrash.py: INTERNAL ERROR: hand-made leaf without parent: Leaf(STRING, '"x3_xxxxxxxx"')
Oh no! 💥 💔 💥
1 file failed to reformat.

cc @bbugyi200

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: crashBlack is crashingF: stringsRelated to our handling of stringsT: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions