Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTERNAL ERROR: Black produced different code on the second pass of the formatter. #2094

Closed
felixhekhorn opened this issue Apr 8, 2021 · 1 comment
Labels
C: unstable formatting Formatting changed on the second pass R: duplicate This issue or pull request already exists T: bug Something isn't working

Comments

@felixhekhorn
Copy link

Describe the bug INTERNAL ERROR: Black produced different code on the second pass of the formatter.

To Reproduce Steps to reproduce the behavior:

  1. Take this snippet
def test_ad_to_evol_map():
    triv_ops = ("S.S", "S.g", "g.S", "g.g", "V.V", "V3.V3", "T3.T3", "V8.V8", "T8.T8")
    # nf=3
    assert sorted(triv_ops) == get_ad_to_evol_map(3)
    # nf=3 + IC
    assert sorted(
        [*triv_ops, "T15.c+", "V15.c-"] #, "c+.c+"", "c-.c-"]
    ) == get_ad_to_evol_map(3, [4])
    # nf=3 + IC + IB
    assert sorted(
        [*triv_ops,"T15.c+", "V15.c-","b+.b+", "b-.b-"]#, "c+.c+"", "c-.c-", "b+.b+", "b-.b-"]
    ) == get_ad_to_evol_map(3, [4, 5])
    # nf=4 + IC + IB
    ks = sorted(
        [*triv_ops, "V15.V15", "T15.T15","T24.b+", "V24.b-"] # , "b+.b+", "b-.b-"]
    )
    assert ks == get_ad_to_evol_map(4, [4, 5])
    # nf=4 + IB
    assert ks == get_ad_to_evol_map(4, [5])
    # nf=6
    assert sorted(
        [*triv_ops, "T15.T15", "V15.V15", "T24.T24", "V24.V24", "T35.T35", "V35.V35"]
    ) == get_ad_to_evol_map(6)
  1. Run Black on it with no arguments
  2. See error

Expected behavior well formated code

Environment (please complete the following information):

  • Version: 20.8b1
  • OS and Python version: Python 3.8.7 (default, Jan 11 2021, 18:20:10) [GCC 10.2.1 20201224] on linux

Does this bug also happen on master? Yes

@felixhekhorn felixhekhorn added the T: bug Something isn't working label Apr 8, 2021
@ichard26 ichard26 added the C: unstable formatting Formatting changed on the second pass label Apr 10, 2021
@ichard26 ichard26 added the R: duplicate This issue or pull request already exists label Apr 25, 2021
@ichard26
Copy link
Collaborator

Hello!

All reproduction cases in this issue format without error on master. The fixing commit was 8672af3 from PR GH-2126. I'll be marking this issue as a duplicate of GH-1629 since that's what GH-2126 aimed to fix and it's highly likely this issue falls under GH-1629.

Since we use the issue tracker as a reflection of what's on master, I'll be closing this issue. If you have any issues, especially with the new (but stable) output, please open a new issue. Oh and the fix should be available in a published release soon, see GH-2125 for more info.

Thank you for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: unstable formatting Formatting changed on the second pass R: duplicate This issue or pull request already exists T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants