Skip to content

JSONError #2666

Description

@fgallaire

In some case, Brython throw the JSONError exception, but there's no JSONError, only JSONDecodeError.

Brython 3.14:

>>> json.loads(StringIO("<html></html>").read())
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    json.loads(StringIO("<html></html>").read())
  File "VFS.json/__init__.py", line 323, in loads
    return _json.loads(s,**kw)
           ~~~~~~~~~~~^^^^^^^^
json.decoder.JSONError: Extra data: line 1 column 1

Python 3.14:

>>> json.loads(StringIO("<html></html>").read())
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    json.loads(StringIO("<html></html>").read())
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fgallaire/.local/share/uv/cpython3.14/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/home/fgallaire/.local/share/uv/cpython3.14/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fgallaire/.local/share/uv/cpython3.14/json/decoder.py", line 363, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions