Skip to content
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

Trailing Commas on Array Elements Don't Throw Exceptions #21

Open
JoshMayberry opened this issue Mar 23, 2021 · 1 comment
Open

Trailing Commas on Array Elements Don't Throw Exceptions #21

JoshMayberry opened this issue Mar 23, 2021 · 1 comment

Comments

@JoshMayberry
Copy link

This is a different issue than #11.
A trailing comma in an array element is not caught. For example,

[
    {
        "banana": true
    },
]

and

[
    "banana",
]

Will not throw an error.

@kaste
Copy link
Contributor

kaste commented Mar 25, 2021

Yes, that's correct and basically #20. The internal python3.3 json module does not report anything of value in this cases, it reports "No JSON object could be decoded" without telling a line nor a column. Using simplejson as in #20 would resolve this. (We probably could report an error on line 1 col 1 just to indicate the error but that wouldn't help the user in finding it.)

If we ever can use python3.8 in an upcoming Sublime Text version, this would solve the issue as well because it ships the better json parser. Not sure what to do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants