VS Code Flake8 linting failed with error KeyError

12 hours ago 1
ARTICLE AD BOX

I have been using the Flake8 VS Code extension for Python linting with no problems.

Recently, with VS Code version 1.118.1 and Flake8 version 2026.4.0, I get the following error notification when opening a Python file or Jupyter Notebook:

Linting failed with error: Traceback (most recent call last): File "c:HOME\.vscode\extensions\ms-python.flake8-2026.4.0\bundled\libs\flake8\plugins\reporter.py", line 34, in make format_plugin = reporters[format_name] ~~~~~~~~~^^^^^^^^^^^^^ KeyError: "'%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s'"

Switching to Flake8 version 2025.2.0 resolves the error.

The error seems to occur on multiple versions of VS Code.

This is being tracked on the Flake8 VS Code extension GitHub repo with the issues 501 and 503.

I'm not sure if a cause has been identified. I wanted to post here in case anyone is looking for the workaround.

Read Entire Article