maximum recursion depth exceeded while calling a Python object #3340
Labels
C: crash
Black is crashing
C: preview style
Issues with the preview and unstable style. Add the name of the responsible feature in the title.
F: strings
Related to our handling of strings
help wanted
Extra attention is needed
T: bug
Something isn't working
Describe the bug
When running black using pre-commit against a generated Django migration file, the following error is observed:
To Reproduce
Here is a file that can reproduce the above issue: https://gist.github.com/trumpet2012/057e1e6bc381081e06a2eaf9e22db45a
Install pre-commit: https://pre-commit.com/index.html#installation
Our pre-commit config is:
Then running:
Results in the above error.
Expected behavior
Black should be able to correctly reformat the file.
Environment
Additional context
It works when you run black without the
--preview
flag.Interestingly, it also works running black directly (bypassing pre-commit) even with the
--preview
flag enabled.Also when I was generating the example file above, I was going through and replacing our internal column names and help text with fake data and when I replaced the
help_text=
strings with justLorem ipsum dolores
it also worked correctly. Increasing the length of the help text strings then caused the issue to reappear.The text was updated successfully, but these errors were encountered: