Skip to content

Subgraphs cause a black.parsing.InvalidInput error. #128

@FleetingOrchard

Description

@FleetingOrchard

As title. Ref. the following exception:

    final_code = black.format_str(final_code, mode=black.Mode())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src\black\__init__.py", line 1208, in format_str
  File "src\black\__init__.py", line 1222, in _format_str_once
  File "src\black\parsing.py", line 98, in lib2to3_parse
black.parsing.InvalidInput: Cannot parse: 164:88:               regexreplace_173:132 = regexreplace.execute(string=get_value_at_index(regexreplace_173:130, 0), regex_pattern="!S2(?P<inner>[^!]*)!", replace="\g<inner>", case_insensitive=True, multiline=True, dotall=False, count=0)

In the tested workflow, that regexreplace node is inside a subgraph. Unpacking the subgraph causes the exception to then show up referencing another node in another subgraph.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions