0

The error:

error: cannot format <filename>.py: Cannot parse: <line-number>:<column-number>: print("\n", end='')

Why can't black format this code? If I remove it, Black just fails again at the next point that it encounters a print function with end in it.

Kalcifer
  • 1,211
  • 12
  • 18

1 Answers1

0

... just to close the question (credits to @Joran Beasley)

Unbalanced parentheses and quotes will lead to this error (that will be reported on further lines if this line is removed).

Be sure to always check that your code is correct: e.g., with Python linters like pylint, Pylance (embedded in VS Code), pylama, ...

Jean-Francois T.
  • 11,549
  • 7
  • 68
  • 107