ffi-navigator
ffi-navigator copied to clipboard
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4622: ordinal not in range(128)
Hi,
When I installed FFI Navigator vscode extension and pip install ffi-navigator, then restart vscode. This error comes out. Is there anyone to meet this before and how can I fix this?
Environment is ubuntu 16.04 docker. Thanks.
[2022-05-01 08:05:00,635] Failed to handle request 0 Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/pyls_jsonrpc/endpoint.py", line 113, in consume self._handle_request(message['id'], message['method'], message.get('params')) File "/usr/lib/python3.6/site-packages/pyls_jsonrpc/endpoint.py", line 182, in _handle_request handler_result = handler(params) File "/usr/lib/python3.6/site-packages/pyls_jsonrpc/dispatchers.py", line 23, in handler return method(**(params or {})) File "/usr/lib/python3.6/site-packages/ffi_navigator/langserver.py", line 47, in m_initialize self.ws.initialize(root_path) File "/usr/lib/python3.6/site-packages/ffi_navigator/workspace.py", line 36, in initialize self._reload() File "/usr/lib/python3.6/site-packages/ffi_navigator/workspace.py", line 51, in _reload self.update_dir(dirname) File "/usr/lib/python3.6/site-packages/ffi_navigator/workspace.py", line 77, in update_dir self.update_doc(path, open(path).readlines()) File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4622: ordinal not in range(128) [Error - 8:05:00 AM] Server initialization failed.
@tqchen
I am encountering similar error -
"UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 2228: character maps to << undefined >>"
My environment setting Windows 11. VSCode 1.69.2 - VSCode extension downloaded and installed via marketplace (version 0.7.0) Python 3.7- ffi-navigator installed via build from source version ffi-navigator==0.5.3 (Anaconda)
Log from VSCode output window for ffi-navigator
[2022-07-28 18:29:47,488] Failed to handle request 1
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\pyls_jsonrpc\endpoint.py", line 178, in _handle_request
handler = self._dispatcher[method]
File "C:\Anaconda3\lib\site-packages\pyls_jsonrpc\dispatchers.py", line 26, in __getitem__
raise KeyError()
KeyError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\pyls_jsonrpc\endpoint.py", line 113, in consume
self._handle_request(message['id'], message['method'], message.get('params'))
File "C:\Anaconda3\lib\site-packages\pyls_jsonrpc\endpoint.py", line 180, in _handle_request
raise JsonRpcMethodNotFound.of(method)
pyls_jsonrpc.exceptions.JsonRpcMethodNotFound: Method Not Found: shutdown
Any help/advise to fix this is really appreciated. Thanks
@gganduu Were you able to solve this?
@gganduu hi,I have the same problem as you, how did you solve it?Thank you for your reply。
@gganduu hi,I have the same problem as you, how did you solve it?Thank you for your reply。
Actually, I did not do anything, just vscode updated by requested by company, then reinstall this ffi and pip install it, then it works on my side now~~
Please try to update your vscode to the latest version, and try again
@gganduu hi,I have the same problem as you, how did you solve it?Thank you for your reply。
Actually, I did not do anything, just vscode updated by requested by company, then reinstall this ffi and pip install it, then it works on my side now~~
Thanks!After I updated vscode as you said, it still doesn't work, the error reported is still “UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 5143: ordinal not in range(128)”.
Please see my pull request https://github.com/tqchen/ffi-navigator/pull/52
I met the same problem and resolved in this way.