Hang when parsing # fmt: on
in the middle of an expression
#2015
Labels
C: performance
Black is too slow. Or too fast.
F: fmtoff
fmt: off implementation
T: bug
Something isn't working
Describe the bug
black
hangs when parsing# fmt: on
in the middle of an expressionTo Reproduce
--target-version py38
Expected behavior
Either black should format the file fine (19.10b0 does not have trouble here) or it should error out and tell me it failed to format.
Environment (please complete the following information):
Does this bug also happen on master? To answer this, you have two options:
latest master branch.
pip install -e .
;python -m unittest
; andblack
like you did last time.Yes, it is happening on the online formatter as well.
Additional context
If I remove
check=True,
from my example, it works fine. If I move# fmt: on
after+ path,
it works fine.We've modified our code to put
# fmt: on
in a more reasonable location, but still wanted to report it as I wouldn't expect a hang.The text was updated successfully, but these errors were encountered: