pappasam / jedi-language-server

A Python language server exclusively for Jedi. If Jedi supports it well, this language server should too.
MIT License
596 stars 45 forks source link

Unrecoverable error when upgrading from 0.41.1 to 0.41.2 #296

Closed mjnur closed 7 months ago

mjnur commented 10 months ago

When opening a notebook, I'm hit with this pop up in the Jupyterlab UI that I cannot close, it just continues to pop up:

image

as well as this error in the server logs (I sanitized the user path):

ValueError: `column` parameter (17) is not in a valid range (0-13) for line 20 ('        self,\n').

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/<user>/.venv/lib/python3.9/site-packages/pygls/protocol/json_rpc.py", line 385, in _send_data
    body = json.dumps(data, default=self._serialize_message)
  File "/usr/local/lib/python3.9/json/__init__.py", line 234, in dumps
    return cls(
  File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/opt/<user>/.venv/lib/python3.9/site-packages/pygls/protocol/json_rpc.py", line 308, in _serialize_message
    return self._converter.unstructure(data)
  File "/opt/<user>/.venv/lib/python3.9/site-packages/cattrs/converters.py", line 238, in unstructure
    return self._unstructure_func.dispatch(
  File "<cattrs generated unstructure lsprotocol.types.ResponseErrorMessage>", line 3, in unstructure_ResponseErrorMessage
    'error': __c_unstr_error(instance.error),
  File "/opt/<user>/.venv/lib/python3.9/site-packages/cattrs/converters.py", line 965, in unstructure_optional
    return None if val is None else _handler(val)
  File "<cattrs generated unstructure lsprotocol.types.ResponseError>", line 3, in unstructure_ResponseError
    'code': instance.code,
AttributeError: 'dict' object has no attribute 'code'

Do I need to pin a certain version of cattrs or another library? Thanks in advance, let me know if I can provide anything else to help debug this.

mjnur commented 10 months ago

I see that my cattrs jumped from 23.1.2 to 23.2.2, so that's probably the root cause, but am wondering if there should be any pins in Jedi? Apologies if this is totally unrelated to this project.

dimbleby commented 10 months ago

probably wants reporting to pygls, I'd be particularly suspicious of this line

pappasam commented 7 months ago

Looks like this is resolved: https://github.com/openlawlibrary/pygls/pull/416, feel free to re-open if it's not