Autopep8 Extension <KeyError>
Innsolit opened this issue · 3 comments
Innsolit commented
Black formatter works fine yet Autopep8 fails when I format the document, here are my settings.json and autopep8 output
settings.json
{
"workbench.colorTheme": "Default Dark Modern",
"editor.fontSize": 16,
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8"
},
"python.formatting.provider": "none",
}
autopep8 output
2023-09-20 23:34:49.248 [info] [Trace - 11:34:49 PM] Sending request 'textDocument/formatting - (2)'.
2023-09-20 23:34:49.253 [info] [Trace - 11:34:49 PM] Received notification 'window/logMessage'.
2023-09-20 23:34:49.253 [info] /bin/python3 -m autopep8 -
2023-09-20 23:34:49.253 [info] [Trace - 11:34:49 PM] Received notification 'window/logMessage'.
2023-09-20 23:34:49.253 [info] CWD formatter: /home/innsolit
2023-09-20 23:34:49.255 [info] [Trace - 11:34:49 PM] Received notification 'window/logMessage'.
2023-09-20 23:34:49.255 [info] [Error - 11:34:49 PM] Traceback (most recent call last):
File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/tool/lsp_server.py", line 429, in _run_tool_on_document
result = utils.run_module(
File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/tool/lsp_utils.py", line 153, in run_module
return _run_module(module, argv, use_stdin, source)
File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/tool/lsp_utils.py", line 138, in _run_module
runpy.run_module(module, run_name="__main__")
File "/usr/lib/python3.10/runpy.py", line 227, in run_module
return _run_code(code, {}, init_globals, run_name, mod_spec)
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/libs/autopep8.py", line 414, in <module>
del pycodestyle._checks['logical_line'][pycodestyle.continued_indentation]
KeyError: <function continued_indentation at 0x7f49fba41ab0>
2023-09-20 23:34:49.255 [info] [Trace - 11:34:49 PM] Received response 'textDocument/formatting - (2)' in 8ms. Request failed: KeyError: <function continued_indentation at 0x7f49fba41ab0> (-32602).
2023-09-20 23:34:49.255 [info] [Error - 11:34:49 PM] Request textDocument/formatting failed.
2023-09-20 23:34:49.255 [info] Message: KeyError: <function continued_indentation at 0x7f49fba41ab0>
Code: -32602
{'traceback': [' File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/libs/pygls/protocol.py", line 340, in _handle_request\n self._execute_request(msg_id, handler, params)\n', ' File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/libs/pygls/protocol.py", line 264, in _execute_request\n self._send_response(msg_id, handler(params))\n', ' File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/tool/lsp_server.py", line 73, in formatting\n edits = _formatting_helper(document)\n', ' File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/tool/lsp_server.py", line 93, in _formatting_helper\n result = _run_tool_on_document(document, use_stdin=True)\n', ' File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/tool/lsp_server.py", line 429, in _run_tool_on_document\n result = utils.run_module(\n', ' File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/tool/lsp_utils.py", line 153, in run_module\n return _run_module(module, argv, use_stdin, source)\n', ' File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/tool/lsp_utils.py", line 138, in _run_module\n runpy.run_module(module, run_name="__main__")\n', ' File "/usr/lib/python3.10/runpy.py", line 227, in run_module\n return _run_code(code, {}, init_globals, run_name, mod_spec)\n', ' File "/usr/lib/python3.10/runpy.py", line 86, in _run_code\n exec(code, run_globals)\n', ' File "/home/innsolit/.vscode/extensions/ms-python.autopep8-2023.6.0/bundled/libs/autopep8.py", line 414, in <module>\n del pycodestyle._checks[\'logical_line\'][pycodestyle.continued_indentation]\n']}
karthiknadig commented
@Innsolit Can you try the pre-release version and see if that helps?
Innsolit commented
Yes, Pre-release works fine.
shamik-biswas-rft commented
getting the same error as above.