Describe the bug
Fails with INTERNAL ERROR on small file
To Reproduce
Contents of repro.py:
a = 1 # type: ignore
b = 1 # fmt: skip
Reproduce:
$ black --check repro.py
error: cannot format repro.py: INTERNAL ERROR: Black 26.5.0 on Python
(CPython) 3.12.11 produced code that is not equivalent to the source.
Please report a bug on https://github.com/psf/black/issues. This diff
might be helpful: /tmp/blk_XXXX.log
The diff is
--- src
+++ dst
@@ -37,8 +37,6 @@
value=
1, # int
) # /Constant
) # /Assign
type_ignores=
- TypeIgnore(
- ) # /TypeIgnore
) # /Module
\ No newline at end of file
Expected behavior
successful formatting
Environment
➜ ✗ black --version
black, 26.5.0 (compiled: yes)
Python (CPython) 3.12.11
Ubuntu 20.04
Additional context
Describe the bug
Fails with INTERNAL ERROR on small file
To Reproduce
Contents of
repro.py:Reproduce:
$ black --check repro.py error: cannot format repro.py: INTERNAL ERROR: Black 26.5.0 on Python (CPython) 3.12.11 produced code that is not equivalent to the source. Please report a bug on https://github.com/psf/black/issues. This diff might be helpful: /tmp/blk_XXXX.logThe diff is
Expected behavior
successful formatting
Environment
Additional context