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

Support trailing comma's #46

Open
harumazzz opened this issue Jan 28, 2023 · 2 comments
Open

Support trailing comma's #46

harumazzz opened this issue Jan 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@harumazzz
Copy link

harumazzz commented Jan 28, 2023

The tool is super weak on JSON Parsing, and stop instantly if the json is trailing commas but object can have trailing commas.

@nineteendo
Copy link
Owner

Example:
trailing_comma.zip

JSONDecodeError in /storage/emulated/0/Download/trailing_comma.json: Expecting property name enclosed in double quotes: line 3 column 1 (char 19)
Traceback (most recent call last):
  File "<string>", line 583, in conversion
  File "<string>", line 528, in file_encode
  File "/storage/emulated/0/Download/PVZ2tools-alpha/PVZ2tools-alpha/PVZ2tools-alpha/OBBEdit/libraries/pyvz2rton.py", line 362, in encode_root_object
    for key, value in load(file, object_pairs_hook = self.encode_object_pairs).data:
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 3 column 1 (char 19)

@nineteendo nineteendo added this to the Release v1.5.0 milestone Jan 28, 2023
@nineteendo nineteendo added the bug Something isn't working label Jan 28, 2023
@nineteendo
Copy link
Owner

As you can see, this is caused by the JSON library I'm using.
I can't do too much about that, but I'll try fixing it when I rewrite json2rton in C.

@nineteendo nineteendo changed the title Support trailing commas Trailing comma's aren't supported Mar 1, 2023
@nineteendo nineteendo added enhancement New feature or request and removed bug Something isn't working labels Jun 25, 2023
@nineteendo nineteendo changed the title Trailing comma's aren't supported Support trailing comma's Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants