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
JSON parsing fails too hard #7285
Labels
Comments
RRosio
added
regression
and removed
status:Needs Triage
Applied to issues that need triage
labels
Mar 5, 2024
@Timeroot, there is already an option to open the JSON files with text editor. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Although the JSON spec does not allow comments, plenty of JSON files have comments in them anyway, e.g.
and plenty of parsers accept (and ignore) these. In Jupyter 6.x, this was fine, and we could edit our .JSON files in Jupyter as a text editor. In Jupyter 7, it seems that the JSON parsing has gotten "smarter". While that's fine and well, it then refuses to give a basic text editor.
The user is just met with "JSON.parse: expected property name or '}' at line 2 column 1 of the JSON data" if there's a comment on the second line. And then no editing functionality is available at all, not even just to fix the file. The only option is to rename the file to .txt, edit like that, and then move the file back to .json.
Reproduce
Create a file named "foo.json" with the body
and open it in Jupyter. Jupyter gives a parse error and then displays no editor.
Expected behavior
Jupyter should give a fallback plain-text editor.
Context
The text was updated successfully, but these errors were encountered: