Skip to content

Black cannot parse previously parseable file in 24.4.1 #4329

@mrmundt

Description

@mrmundt

Describe the bug

The newest version of black started failing on our CI due to an error about not being able to parse a line that it used to be able to parse just fine.

To Reproduce

On the file pyomo/contrib/pyros/util.py: black pyomo/contrib/pyros/util.py

The resulting error is:

error: cannot format pyomo/contrib/pyros/util.py: Cannot parse: 2009:77: return f"{attr_val_str:{f'{self._ATTR_FORMAT_LENGTHS[attr_name]}'}}"

Expected behavior

It doesn't just error and fail on that file.

Environment

  • Black's version: 24.4.1
  • OS and Python version: MacOS 3.11; Ubuntu 22.04 3.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions