-
Notifications
You must be signed in to change notification settings - Fork 9
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
Python langpack crash on receiving invalid JSON #9
Comments
Looks like ruby and others might have the same issue: |
I'm confused given that "this shouldn't ever happen". Do you just mean that we should still |
Also note that if JSON parsing is aggressively minimized then this langpack JSON parse is the only place that is absolutely required to perform a JSON parse (all other pieces in the stack can theoretically pass it blind) so if these caught malformed JSON in a standardized way then the extra parsing steps can be removed. |
I mean more that we've tested the langserver and it shouldn't send bad JSON; but I was testing the pipe script directly (outside of langserver) and had issues. But yeah, mostly for good practice, help prevent if there was a bug in langserver too etc. I just wanted to call it out since in Go langpack I'm doing an explicit if err := json.Unmarshal(input, &r); err != nil {
// return SystemFailure
} I don't suppose I have to, but just thought consistency across would be ideal (mostly in that the user would probably just see an |
This shouldn't ever happen with langserver sending data, but the result would be a confusing error message to the user:
https://github.com/algorithmiaio/langpacks/blob/master/python/template/bin/pipe.py#L28
The text was updated successfully, but these errors were encountered: