Really not sure what happened here; I was certain I posted a reply on Tuesday. Anyway, here it is again:
python:
>>> import requests
>>> import simplejson
>>> requests.__version__
'2.32.3'
>>> simplejson.loads('no content')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 514, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 386, in decode
obj, end = self.raw_decode(s)
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 416, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
>>> requests.get('https://google.com')
<Response [200]>
>>> simplejson.loads('no content')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 514, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 386, in decode
obj, end = self.raw_decode(s)
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 416, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Tests done without simplejson
here.
With simplejson back in, it actually crashed on test no.3 and 4
without errors in the log, so I did a GDB:
gdb:
#3 Frame 0x7fffbf005510, for file /usr/lib/python3/dist-packages/simplejson/errors.py, line 7, in linecol (doc='no continue watching items', pos=0)
lineno = doc.count('\n', 0, pos) + 1
#3 Frame 0x7fffbf005438, for file /usr/lib/python3/dist-packages/simplejson/errors.py, line 16, in errmsg (msg='Expecting value', doc='no continue watching items', pos=0, end=None)
lineno, colno = linecol(doc, pos)
#3 Frame 0x7fffbf005380, for file /usr/lib/python3/dist-packages/simplejson/errors.py, line 41, in __init__ (self=<JSONDecodeError at remote 0x7fff542c9be0>, msg='Expecting value', doc='no continue watching items', pos=0, end=None)
ValueError.__init__(self, errmsg(msg, doc, pos, end=end))
#18 Frame 0x7fffbf0052d0, for file /usr/lib/python3/dist-packages/simplejson/decoder.py, line 416, in raw_decode (self=<JSONDecoder(encoding='utf-8', object_hook=None, object_pairs_hook=None, parse_float=<type at remote 0x7ffff7b58600>, parse_int=<type at remote 0x7ffff7b5adc0>, parse_constant=None, strict=True, parse_object=<function at remote 0x7fff4972ab60>, parse_array=<function at remote 0x7fff4972ac00>, parse_string=<built-in method scanstring of module object at remote 0x7fff6eb09030>, memo={}, scan_once=<simplejson._speedups.Scanner at remote 0x7fff542ca960>) at remote 0x7fff6c3d9490>, s='no continue watching items', idx=0, _w=<builtin_method at remote 0x7fff6c28c3b0>, _PY3=True, ord0=110)
return self.scan_once(s, idx=_w(s, idx).end())
#18 Frame 0x7fffbf005218, for file /usr/lib/python3/dist-packages/simplejson/decoder.py, line 386, in decode (self=<JSONDecoder(encoding='utf-8', object_hook=None, object_pairs_hook=None, parse_float=<type at remote 0x7ffff7b58600>, parse_int=<type at remote 0x7ffff7b5adc0>, parse_constant=None, strict=True, parse_object=<function at remote 0x7fff4972ab60>, parse_array=<function at remote 0x7fff4972ac00>, parse_string=<built-in method scanstring of module object at remote 0x7fff6eb09030>, memo={}, scan_once=<simplejson._speedups.Scanner at remote 0x7fff542ca960>) at remote 0x7fff6c3d9490>, s='no continue watching items', _w=<builtin_method at remote 0x7fff54283dd0>, _PY3=True)
obj, end = self.raw_decode(s)
#18 Frame 0x7fffbf005150, for file /usr/lib/python3/dist-packages/simplejson/__init__.py, line 514, in loads (s='no continue watching items', encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, use_decimal=False, allow_nan=False, kw={})
return _default_decoder.decode(s)
#18 Frame 0x7fffbf0050b8, for file /home/james/.kodi/addons/plugin.video.smpljsoncrashtest/addon.py, line 97, in test_simpjson_loads (simplejson=<module at remote 0x7fff542804f0>, requests=None)
simplejson.loads(DOC)
#18 Frame 0x7fffbf005020, for file /home/james/.kodi/addons/plugin.video.smpljsoncrashtest/addon.py, line 189, in <module> () callb()