INTERNAL ERROR: Black produced code that is not equivalent to the source #2882
Copy link
Copy link
Closed
Labels
F: fmtofffmt: off implementationfmt: off implementationT: bugSomething isn't workingSomething isn't working
Description
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:
- 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
Environment
- Black's version: 22.1.0
- OS and Python version: macOS 12.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
F: fmtofffmt: off implementationfmt: off implementationT: bugSomething isn't workingSomething isn't working
Activity
Jackenmen commentedon Feb 14, 2022
All of the examples seem to run into the same issue that can be reproduced by this minimal reproduction:
JelleZijlstra commentedon Feb 14, 2022
Thanks, this might be a duplicate of #569 in that case.
Fix a crash when `# fmt: on` is used on a different block level than …
Bump from upstream (#3)
Upstream force (#8)