-
Notifications
You must be signed in to change notification settings - Fork 378
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
Response: 400 JSON parse error: Unexpected end of input #719
Comments
In case this isn't obvious. The issue is why a absolute path encoded differently but legally (i.e. with or without |
All the existing plugins are sending regular unescaped slashes in filenames, and that works. The error comes from Could you show the full JSON data that causes the problem? Does |
Hi @marijnh, Thanks for your reply and sorry for my delay. I have come up with a recipe to reproduce the problem. The problem only exhibits in emacs 25 so you will need that. It will also use the
Change The full JSON data is pasted in https://bpaste.net/show/0563125585d9 which JSON.parse seems to happily accept. Leo |
Hi @marijnh, I wonder if you have time to look at this issue. I think only the json.el from Thanks, |
That information seems to point towards a bug (or backwards incompatibility) in the JSON serializer that ships with Emacs 25. Have you tried adding a logging statement just before the |
Sorry I missed your reply on this issue. Indeed the problem seems to be with Emacs. I made a http server to catch the request sent from emacs and it stripped some chars at the end of the JSON doc leading to unbalanced parentheses. I'll speak with emacs maintainers to know what is going on. [update] bug logged with emacs: http://debbugs.gnu.org/23750 |
@leoliu Can you verify whether |
hi @dgutov, yes the serialised json string from |
OK, good. I wonder if you can reduce the scenario to something easier to debug: does URL truncate the request body in these circumstances independent of its contents? Or are buffer contents and/or using JSON somehow important? |
similar issue: #605. |
Hmm. Since it's easy to make a mistake, maybe URL should check whether the string it's passed is multibyte. |
Agreed. There is a fixme in |
The terminal running
tern --verbose
printsafter sending the following JSON document to the tern server:
where ... is the JSON string of the file
tern.js
.Note also tern server replies successfully if sent JSON doc:
or
I wonder if there is bug somewhere? I noticed this problem after observing some behaviour difference in emacs 24.5 and 25.0.91.
Thanks,
Leo
The text was updated successfully, but these errors were encountered: