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 code that is not equivalent to the source. #1672

Closed
ikeikeikeike opened this issue Sep 3, 2020 · 5 comments
Closed
Labels
F: strings Related to our handling of strings T: bug Something isn't working

Comments

@ikeikeikeike
Copy link

Describe the bug

A docstring is contained U+3000 ideographic space before new line code.

To Reproduce Steps to reproduce the behavior:

$ cat u3000.py
class Foo:
    """line1 
    line2
    """
$ cat /tmp/blk_doc2utq5.log
--- src
+++ dst
@@ -5,11 +5,11 @@
       body=
         Expr(
           value=
             Constant(
               value=
-                'line1\u3000\nline2',  # str
+                'line1\nline2',  # str
             )  # /Constant
         )  # /Expr
       decorator_list=
       keywords=
       name=

Environment (please complete the following information):

  • Version: 20.8b1
  • OS and Python version: Linux/Python 3.7.8

Does this bug also happen on master?

YES(20.8b2.dev12+g6b935a3)

@ikeikeikeike ikeikeikeike added the T: bug Something isn't working label Sep 3, 2020
@markgajdosik
Copy link

Having a similar problem where Black 20.8b1, despite -S, strips \t from docstring, ending up with a different result.

@ultrabug
Copy link

ultrabug commented Sep 6, 2020

While inspecting recent CI failure due to black formatting on https://github.com/ultrabug/py3status I got the same error from black.

black, version 20.8b1

error: cannot format /home/alexys/github/py3status/py3status/py3.py: INTERNAL ERROR: Black produced code that is not equivalent to the source.

With log file as attached:
blk_ie_wm_8t.log

Hope this helps, thanks!

ultrabug added a commit to ultrabug/py3status that referenced this issue Sep 6, 2020
@esmail
Copy link

esmail commented Sep 15, 2020

@markgajdosik and @ultrabug, I think your issues are duplicates of #1635, whereas OP's looks like a unicode character being removed.

@PaulusElektrus
Copy link

I am getting the same error.
Code contains very long docstrings, these are also in the log.

Log Attached:
blk_21_a5ozp.log

@JelleZijlstra
Copy link
Collaborator

This no longer crashes.

@ichard26 ichard26 added the F: strings Related to our handling of strings label May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: strings Related to our handling of strings T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants