Skip to content

INTERNAL ERROR: Black produced code that is not equivalent to the source #2882

Closed

Description

@amyreese

Describe the bug

Error formatting python sources in https://github.com/pytorch/fairseq

To Reproduce

Clone fairseq and run black on offending files:

fairseq $ black --version
black, 22.1.0 (compiled: yes)

fairseq $ black --check \
  examples/simultaneous_translation/modules/monotonic_multihead_attention.py \
  examples/speech_text_joint_to_text/criterions/text_guide_cross_entropy_acc.py \
  examples/wav2vec/unsupervised/scripts/pca.py

error: cannot format examples/wav2vec/unsupervised/scripts/pca.py: INTERNAL ERROR: Black produced code that is not equivalent to the source.  Please report a bug on https://github.com/psf/black/issues.  This diff might be helpful: /var/folders/jg/hrl2p4ms1vjbn44gmmyl4p7r0000gn/T/blk_lda03pi7.log
error: cannot format examples/speech_text_joint_to_text/criterions/text_guide_cross_entropy_acc.py: INTERNAL ERROR: Black produced code that is not equivalent to the source.  Please report a bug on https://github.com/psf/black/issues.  This diff might be helpful: /var/folders/jg/hrl2p4ms1vjbn44gmmyl4p7r0000gn/T/blk_ctr_udzr.log
error: cannot format examples/simultaneous_translation/modules/monotonic_multihead_attention.py: INTERNAL ERROR: Black produced code that is not equivalent to the source.  Please report a bug on https://github.com/psf/black/issues.  This diff might be helpful: /var/folders/jg/hrl2p4ms1vjbn44gmmyl4p7r0000gn/T/blk_u26gqsix.log

Oh no! 💥 💔 💥
3 files would fail to reformat.

Debug diffs:

Environment

  • Black's version: 22.1.0
  • OS and Python version: macOS 12.1

Activity

  1. Jackenmen commented on Feb 14, 2022

    @Jackenmen
    Contributor

    All of the examples seem to run into the same issue that can be reproduced by this minimal reproduction:

    def func1():
        # fmt: off
        abc = 123
    
    def func2():
        abc = 123
  2. JelleZijlstra commented on Feb 14, 2022

    @JelleZijlstra
    Collaborator

    Thanks, this might be a duplicate of #569 in that case.

  3. added a commit that references this issue on Sep 24, 2022
    55db055
  4. added a commit that references this issue on Oct 6, 2022
    81d333f
  5. added a commit that references this issue on Oct 27, 2022
    e5a4a0f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    F: fmtofffmt: off implementationT: bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions