# Buggy code
def sys_path(self, environment_path=None):
    # Copy our extra sys path
    path = list(self._extra_sys_path)
    environment = self.get_enviroment(environment_path=environment_path)
    path.extend(environment.get_sys_path())
    return path


# Traceback (TypeError)
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1440, in handle_go_to_definition
def_range = position['range']
TypeError: list indices must be integers or slices, not str

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\ProgramData\Anaconda3\lib\logging\__init__.py", line 992, in emit
msg = self.format(record)
File "c:\ProgramData\Anaconda3\lib\logging\__init__.py", line 838, in format
return fmt.format(record)
File "c:\ProgramData\Anaconda3\lib\logging\__init__.py", line 575, in format
record.message = record.getMessage()
File "c:\ProgramData\Anaconda3\lib\logging\__init__.py", line 338, in getMessage
msg = msg % self.args
ValueError: incomplete format
Call stack:
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\app\start.py", line 223, in <module>
main()
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\app\start.py", line 219, in main
mainwindow.main()
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3651, in main
mainwindow = run_spyder(app, options, args)
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3567, in run_spyder
app.exec_()
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\completion\languageserver\client.py", line 497, in on_msg_received
self.req_reply[req_id](None, {'params': []})
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\completion\languageserver\plugin.py", line 549, in receive_response
self.COMPLETION_CLIENT_NAME, req_id, response)
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\completion\plugin.py", line 123, in receive_response
self.howto_send_to_codeeditor(req_id)
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\completion\plugin.py", line 171, in howto_send_to_codeeditor
self.skip_and_send_to_codeeditor(req_id)
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\completion\plugin.py", line 205, in skip_and_send_to_codeeditor
self.gather_and_send_to_codeeditor(request_responses)
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\completion\plugin.py", line 273, in gather_and_send_to_codeeditor
response_instance.handle_response(req_type, responses)
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1019, in handle_response
handler(params)
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1457, in handle_go_to_definition
"Error when processing go to definition")
File "c:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1050, in log_lsp_handle_errors
logger.error('%', 1, stack_info=True)
Message: '%'
Arguments: (1,)

# Fixed code
def sys_path(self, environment_path=None, env_vars=None):
    # Copy our extra sys path
    # TODO: when safe to break API, use env_vars explicitly to pass to create_environment
    path = list(self._extra_sys_path)
    environment = self.get_enviroment(
        environment_path=environment_path, env_vars=env_vars
    )
    path.extend(environment.get_sys_path())
    return path