Skip to content

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

@funilrys

Description

@funilrys

Operating system: Arch Linux
Python version: Python 3.6.4
Black version: black, version 18.4a0
Does also happen on master: Not tested when I started to write this issue but it's confusing when blacking code from different branches 😹 👍

Hello @ambv and thanks for this 👍 I was using it for replacement of autopep8 in private project and I feel like it was time to test it in some of my Open Source projects.

So as black told me to report a bug so kindly:

error: cannot format PyFunceble.py: INTERNAL ERROR: Black produced code that is not equivalent to the source. Please report a bug on https://github.com/ambv/black/issues. This diff might be helpful: /tmp/blk_z44me8pc.log

Here am I.

Here's the diff out of virtualenv:

--- src
+++ dst
@@ -38877,11 +38877,11 @@
                       s=
                         'Expired:(.*)',  # str
                     )  # /Str
                     Str(
                       s=
-                        "Date d\\'expiration:(.*)",  # str
+                        "Date d'expiration:(.*)",  # str
                     )  # /Str
                 )  # /List
             )  # /Assign
             If(
               body=

and the diff into virtualenv:

--- src
+++ dst
@@ -38877,11 +38877,11 @@
                       s=
                         'Expired:(.*)',  # str
                     )  # /Str
                     Str(
                       s=
-                        "Date d\\'expiration:(.*)",  # str
+                        "Date d'expiration:(.*)",  # str
                     )  # /Str
                 )  # /List
             )  # /Assign
             If(
               body=

The affected code was PyFunceble for the following line:

r'Date d\'expiration:(.*)']

Thanks again 🥇

Have a nice day/night.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions