Skip to content

error: cannot format Tests/test_file_libtiff.py: (-1, 8) #1605

@hugovk

Description

@hugovk

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Take this file https://github.com/python-pillow/Pillow/blob/e54909b97c213278accc8176f1c52e403f8afcb6/Tests/test_file_libtiff.py
  2. Run Black on it with these arguments --check Tests/test_file_libtiff.py
  3. See error
$ black --version
black, version 19.10b1.dev141+g820f387
$ black --check Tests/test_file_libtiff.py
error: cannot format Tests/test_file_libtiff.py: (-1, 8)
Oh no! 💥 💔 💥
1 file would fail to reformat.

Expected behavior A clear and concise description of what you expected to happen.

File formats.

Environment (please complete the following information):

  • Version: master
  • OS and Python version: macOS/Python 3.8.3

Does this bug also happen on master? To answer this, you have two options:

Yes, see above.

Works with last release (the codebase is already formatted with that version):

$ black --version
black, version 19.10b0
$ black --check Tests/test_file_libtiff.py
All done! ✨ 🍰 ✨
1 file would be left unchanged.

Additional context Add any other context about the problem here.

Looks like it's this part:

                            assert (
                                c_float(val[0][0] / val[0][1]).value
                                == c_float(value[0][0] / value[0][1]).value
                            ), ("%s didn't roundtrip" % tag)

https://github.com/python-pillow/Pillow/blob/e54909b97c213278accc8176f1c52e403f8afcb6/Tests/test_file_libtiff.py#L171-L174

(We're about to drop Python 3.5 and adopt f-strings, it's replacement is handled fine:

                            assert (
                                c_float(val[0][0] / val[0][1]).value
                                == c_float(value[0][0] / value[0][1]).value
                            ), f"{tag} didn't roundtrip"

)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: crashBlack is crashingR: duplicateThis issue or pull request already existsT: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions