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 multiline docstring with tab #1777

Closed
adampinky85 opened this issue Oct 22, 2020 · 1 comment
Closed

Internal error multiline docstring with tab #1777

adampinky85 opened this issue Oct 22, 2020 · 1 comment
Labels
T: bug Something isn't working

Comments

@adampinky85
Copy link

Describe the bug
Internal error is thrown parsing a multi-line docstring which includes a tab. This issue appears to be a regression upgrading between black 19.10b0 and 20.8b1.

To Reproduce

def tab_internal_error():
    """
    Param:	<- tab before description fails to parse
    """
    pass

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

--- src
+++ dst
@@ -16,11 +16,11 @@
       body=
         Expr(
           value=
             Constant(
               value=
-                'Param:\t<- tab before description fails to parse',  # str
+                'Param:      <- tab before description fails to parse',  # str
             )  # /Constant
         )  # /Expr
         Pass(
         )  # /Pass
       decorator_list=

Expected behavior
n/a

Environment
Ubuntu 20.04.1 LTS
Python 3.8.6
black==20.8b1

Does this bug also happen on master?
Yes reproducible from the minimal viable example on the master black playground

Additional context
Thanks to all involved in the project. Black has materially improved the quality of our code and is a core part of our CI/CD.

@adampinky85 adampinky85 added the T: bug Something isn't working label Oct 22, 2020
@ichard26
Copy link
Collaborator

Closing as this has been fixed by #1128:

(black) ichard26@acer-ubuntu:~/programming/oss/black$ python --version
Python 3.8.5
(black) ichard26@acer-ubuntu:~/programming/oss/black$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal
(black) ichard26@acer-ubuntu:~/programming/oss/black$ git log -n 1 --oneline
1d8b4d7 (HEAD -> main, upstream/master) Correctly handle inline tabs in docstrings (#1810)
(black) ichard26@acer-ubuntu:~/programming/oss/black$ black test.py --diff --color
All done! ✨ 🍰 ✨
1 file would be left unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants