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
Black fails on docstring with linebreak #3727
Comments
Can't repro on current main nor on 23.3.0 running Python 3.9.16.
There also seems to be plenty of tests for trailing backslash in docstrings. So maybe this should be closed? |
Interesting, I can still repro on f7cbe4a:
|
I can also still reproduce it, both on current main and on 23.3.0 as @henriholopainen tried, and both with and without |
Ok, apparently the issue is a trailing whitespace after the backslash. I can try and take a look at this tomorrow. Thanks for the repro steps all! |
While this was a true error, the error was rooted in the trailing whitespace, which probably wasn't intentional. Fix in 4008. |
Describe the bug
When you have a docstring and add a \ at the end of the line to get a line break black can't deal with it.
To Reproduce
For example, take this code:
It works completely fine(im on python version 3.9.7). But when I now add a \ to get a linebreak it stops working
The resulting error is:
Content of /var/tmp/blk_jkcx46wd.log:
Expected behavior
Black usually shouldn't mess with docstrings since they are not part of the source code. And can sometimes be confusing semi-code. It should just work.
Environment
Additional context
Sadly I can't share anymore code since it's from a closed codebase but if there are any more questions I will try to answer as good as I can
The text was updated successfully, but these errors were encountered: