GenSON icon indicating copy to clipboard operation
GenSON copied to clipboard

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Open ssbarnea opened this issue 6 years ago • 1 comments

Traceback (most recent call last):
File "/Users/ssbarnea/.pyenv/versions/3.7.4/bin/genson", line 8, in <module>
sys.exit(main())
File "/Users/ssbarnea/.pyenv/versions/3.7.4/lib/python3.7/site-packages/genson/cli.py", line 25, in main
add_json_from_file(builder, object_file, args.delimiter)
File "/Users/ssbarnea/.pyenv/versions/3.7.4/lib/python3.7/site-packages/genson/cli.py", line 97, in add_json_from_file
method(json.loads(json_string))
File "/Users/ssbarnea/.pyenv/versions/3.7.4/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/Users/ssbarnea/.pyenv/versions/3.7.4/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/ssbarnea/.pyenv/versions/3.7.4/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

As you can see this doesn't even display the filename that it failed to load.... and I have ~60 files. Time to find the needle in the haystack.

The behaviour needs to be improved to avoid that kind of less-than-useful output.

ssbarnea avatar Jan 12 '20 13:01 ssbarnea

Yeah, that's a really reasonable request. I'll have a look and see how feasible this is. It might be a couple weeks though.

wolverdude avatar Jan 13 '20 05:01 wolverdude

This is fixed in v1.3.0

wolverdude avatar May 15 '24 22:05 wolverdude