-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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: Black produced code that is not equivalent to the source #4481
Comments
Hmm, we should ban running on 3.12.5 as of #4447 , because an upstream memory safety issue can cause AST safety checks to fail. Do you have a local repro, if so, could you figure out why the check against 3.12.5 isn't working for you? Looks like the issue is unrelated to that, though. Probably a duplicate of #3608 |
Just to clarify, Python 3.12.5 was being used in the playground, and I was able to reproduce the same issue locally as well. My local setup uses Black 24.10.0 and CPython 3.11.2.
Yes, I was able to reproduce the issue locally with Black 24.10.0 and CPython 3.11.2. The same internal error occurs with the provided code snippet. |
Another piece of code that seems to hit this bug (happens at least with 3.11-3.13):
Still, in my case, I have no case of using no fmt comments. |
Describe the bug
Formatting the code snippet below produces an internal error.
To Reproduce
Format the following code snippet:
The resulting error is:
Log:
Expected behavior
The lines should be left untouched.
Environment
Can also be reproduced on https://black.vercel.app/?version=main&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4ADHAGZdAD2IimZxl1N_WlkOE2WKO8q04xFLHliTY02DINaThb5NmXp3LURBIVoPx1hVWZbZyQHzS7z4xwAjKn-Mq7mHuHTZTmuDTTSwvMjOpdZEDkCdYF5Qlw2K-7fLc9LT6VrsBXcNyBZpZgAAANIVr-TpMphLAAGCAcgBAABg5HYfscRn-wIAAAAABFla .
The text was updated successfully, but these errors were encountered: