Black --preview mode produces invalid code in the first pass, causing second pass to fail #3117
Labels
C: invalid code
Black destroyed a valid Python file
F: strings
Related to our handling of strings
T: bug
Something isn't working
Describe the bug
Black's --preview mode produces invalid code in the first pass, causing second pass to fail.
To Reproduce
For example, take this code:
And run it with these arguments:
The resulting error is:
Expected behavior
It should succeed.
Environment
Additional context
_format_str_once
call formats the code to:The text was updated successfully, but these errors were encountered: