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

"not equivalent to the source" error #1181

Closed
ivirshup opened this issue Nov 29, 2019 · 4 comments
Closed

"not equivalent to the source" error #1181

ivirshup opened this issue Nov 29, 2019 · 4 comments
Labels
C: invalid code Black destroyed a valid Python file R: duplicate This issue or pull request already exists T: bug Something isn't working

Comments

@ivirshup
Copy link

ivirshup commented Nov 29, 2019

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

Black errors while checking a file.

To Reproduce Steps to reproduce the behavior:

  1. Take this file
  2. Run Black on it with these arguments --check --diff
  3. See error
error: cannot format scanpy/metrics/_gearys_c.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/bd/43q20k0n6z15tdfzxvd22r7c0000gn/T/blk_ag2u14jv.log
Oh no! 💥 💔 💥
1 file would fail to reformat.
  • Version: master and release
  • OS and Python version: macOS for master and release, version black-19.10b0 on travis (failed build). Python 3.7 all around.

Does this bug also happen on master?

Yup. Not using the online formatter, but I installed it locally (macOS) and it failed

Additional context

Log contents (gist)

@JelleZijlstra
Copy link
Collaborator

This looks like the same tabs/spaces issue that caused #1170.

@ivirshup
Copy link
Author

Update: If I remove the # fmt: off comment on line 102 the error stops occurring.

@ivirshup
Copy link
Author

ivirshup commented Mar 2, 2021

Just came back to say I was getting this issue with black==20.8b1. However, I closed the # fmt: off with a # fmt: on and now it works.

@ichard26 ichard26 added R: duplicate This issue or pull request already exists C: invalid code Black destroyed a valid Python file labels Apr 16, 2021
@ichard26
Copy link
Collaborator

@ivirshup good to know! In that case, I'll close this issue as another case of GH-569.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: invalid code Black destroyed a valid Python file R: duplicate This issue or pull request already exists T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants