-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnicodeDecodeError via client/base_request.py", line 92, in SendRequest #821
Comments
There's a bug somewhere here, but it's hard to track down. I think Vim is giving YCM some badly encoded string data, but I can't find where. If you could produce a test case for this, I'd appreciate it. This is likely related to having non-ASCII chars in your buffer or path to the buffer (neither of which would normally be a problem, and yet we have this issue). |
Like I've said, I can reproduce it when redirecting the output from I have tracked it down to a single char/byte: Hex 00db. However, when saving and reading the buffer which contains it, it changes from being displayed as It can be reproduced by defining the following map, and then redirecting the output from
|
Besides fixing the bug, it would be very nice, if errors like that wouldn't be that noisy. |
hi, there. I bump into a similar problem like this one. I was given some files zipped under Windows and when I unzip it, its file name is not right:
And after I closed files opened under that directory, YCM throws an error:
I printed the data and found that the data dictionary contains non-UTF8 characters, so the dumps function in json module is not working properly. I added an 'ensure_ascii=False' option to the dumps function, and the problem was solved. I suspect @blueyed bumped into a similar problem and json dumps just failed. I'm not sure whether it is safe to add this 'ensure_ascii' option to every instance of dumps function call in YCM, so I did not prepare a pull request. I really hope @Valloric would look into the problem. Sorry again that I cannot provide a valid pull request. |
@xiaket Thanks for the heads-up on the I still can't repro this issue so please confirm that it's fixed. |
It is not fixed. I have the same error. |
@Remiol My test case from above appears to be fixed. |
@blueyed |
@Remiol If I may ask, how can you be sure that you bumped into this error instead of an installation issue? |
@xiaket maybe it was an installation issue, I'm not sure. |
For what it's worth, I'm still experiencing this issue, while editing Now the interesting part is that the error only seems to trigger on long documents, and then again only when the form feeds are there (I use them to separate longer documents into sections since vim section navigation is what it is). In the files where I can reproduce it, simply removing the form feeds seems to be sufficient to not trigger the error. I'm not sure how this may be related though. I can share one such file if needed. |
If you have a reproducible test case, that would be great! Could you raise a new issue and follow the instructions in the CONTRIBUTING.md and/or the new issue template? |
Sure, I'll give it a go. Let me first check if I can reduce the test case to a more manageable size |
There we go. The test case isn't as minimal as I could hope, so I'm hosting it on a website of mine. |
Thanks. Any test case is better than no test case! :) |
I am experimenting with Vim mappings to Alt/Meta keys in terminal Vim (resulting in strange characters being used), and when I had opened the output from
:map
viaredir
in a new buffer, it resulted in the following YCM error.It is really nasty, because it keeps popping up after having closed the buffer.
Is there a way to disable YCM, without having to restart Vim?
:YcmRestart
did not help.The text was updated successfully, but these errors were encountered: