# Buggy code
def __init__(
    self,
    parent,
    server_args_fmt="",
    server_settings={},
    external_server=False,
    folder=getcwd_or_home(),
    language="python",
    plugin_configurations={},
):
    QObject.__init__(self)
    # LSPMethodProviderMixIn.__init__(self)
    self.manager = parent
    self.zmq_in_socket = None
    self.zmq_out_socket = None
    self.zmq_in_port = None
    self.zmq_out_port = None
    self.transport_client = None
    self.language = language

    self.initialized = False
    self.ready_to_close = False
    self.request_seq = 1
    self.req_status = {}
    self.plugin_registry = {}
    self.watched_files = {}
    self.req_reply = {}

    self.transport_args = [
        sys.executable,
        "-u",
        osp.join(LOCATION, "transport", "main.py"),
    ]
    self.external_server = external_server

    self.folder = folder
    self.plugin_configurations = plugin_configurations
    self.client_capabilites = CLIENT_CAPABILITES
    self.server_capabilites = SERVER_CAPABILITES
    self.context = zmq.Context()

    server_args = server_args_fmt % (server_settings)
    # transport_args = self.local_server_fmt % (server_settings)
    # if self.external_server:
    transport_args = self.external_server_fmt % (server_settings)

    self.server_args = [sys.executable, "-m", server_settings["cmd"]]
    self.server_args += server_args.split(" ")
    self.transport_args += transport_args.split(" ")
    self.transport_args += ["--folder", folder]
    self.transport_args += ["--transport-debug", str(get_debug_level())]


# Traceback (configparser.InterpolationMissingOptionError)
Traceback (most recent call last):
File "C:\Users\User\spyder\bootstrap.py", line 178, in <module>
from spyder.app import start  # analysis:ignore
File "C:\Users\User\spyder\spyder\app\start.py", line 34, in <module>
from spyder.config.main import CONF
File "C:\Users\User\spyder\spyder\config\main.py", line 757, in <module>
raw_mode=True)
File "C:\Users\User\spyder\spyder\config\user.py", line 218, in __init__
self._update_defaults(defaults, old_ver)
File "C:\Users\User\spyder\spyder\config\user.py", line 289, in _update_defaults
old_value = old_defaults.get(section, option)
File "C:\Python36\lib\configparser.py", line 800, in get
d)
File "C:\Python36\lib\configparser.py", line 394, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "C:\Python36\lib\configparser.py", line 434, in _interpolate_some
option, section, rawval, var) from None
configparser.InterpolationMissingOptionError: Bad value substitution: option 'python' in section 'lsp-server' contains an interpolation key 'host' which is not a valid option name. Raw value: "{'index': 0, 'cmd': 'pyls', 'args': '--host %(host)s --port %(port)s --tcp', 'host': '127.0.0.1', 'port': 2087, 'external': False, 'configurations': {'pyls': {'configurationSources': ['pycodestyle', 'pyflakes'], 'plugins': {'pycodestyle': {'enabled': True, 'exclude': [], 'filename': [], 'select': [], 'ignore': [], 'hangClosing': False, 'maxLineLength': 79}, 'pyflakes': {'enabled': True}, 'yapf': {'enabled': False}, 'pydocstyle': {'enabled': False, 'convention': 'pep257', 'addIgnore': [], 'addSelect': [], 'ignore': [], 'select': [], 'match': '(?!test_).*\\\\.py', 'matchDir': '[^\\\\.].*'}, 'rope': {'extensionModules': None, 'ropeFolder': []}, 'rope_completion': {'enabled': False}, 'jedi_completion': {'enabled': True}, 'jedi_hover': {'enabled': True}, 'jedi_references': {'enabled': True}, 'jedi_signature_help': {'enabled': True}, 'jedi_symbols': {'enabled': True, 'all_scopes': True}, 'mccabe': {'enabled': False, 'threshold': 15}, 'preload': {'enabled': True, 'modules': []}}}}}"

# Fixed code
def __init__(
    self,
    parent,
    server_args_fmt="",
    server_settings={},
    external_server=False,
    folder=getcwd_or_home(),
    language="python",
    plugin_configurations={},
):
    QObject.__init__(self)
    # LSPMethodProviderMixIn.__init__(self)
    self.manager = parent
    self.zmq_in_socket = None
    self.zmq_out_socket = None
    self.zmq_in_port = None
    self.zmq_out_port = None
    self.transport_client = None
    self.language = language

    self.initialized = False
    self.ready_to_close = False
    self.request_seq = 1
    self.req_status = {}
    self.plugin_registry = {}
    self.watched_files = {}
    self.req_reply = {}

    self.transport_args = [
        sys.executable,
        "-u",
        osp.join(LOCATION, "transport", "main.py"),
    ]
    self.external_server = external_server

    self.folder = folder
    self.plugin_configurations = plugin_configurations
    self.client_capabilites = CLIENT_CAPABILITES
    self.server_capabilites = SERVER_CAPABILITES
    self.context = zmq.Context()

    server_args = server_args_fmt.format(**server_settings)
    # transport_args = self.local_server_fmt % (server_settings)
    # if self.external_server:
    transport_args = self.external_server_fmt % (server_settings)

    self.server_args = [sys.executable, "-m", server_settings["cmd"]]
    self.server_args += server_args.split(" ")
    self.transport_args += transport_args.split(" ")
    self.transport_args += ["--folder", folder]
    self.transport_args += ["--transport-debug", str(get_debug_level())]