-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed as not planned
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
Description
json.load()
documentation lists JSONDecodeError
and UnicodeDecodeError
as the exceptions that can be raised.
But in https://news.ycombinator.com/item?id=44344864 it was noted that RecursionError
is possible too:
>>> import json
>>> json.loads('[' * 9999)
Traceback (most recent call last):
File "<python-input-1>", line 1, in <module>
json.loads('[' * 9999)
~~~~~~~~~~^^^^^^^^^^^^
File "/usr/lib/python3.13/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
~~~~~~~~~~~~~~~~~~~~~~~^^^
File "/usr/lib/python3.13/json/decoder.py", line 345, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/json/decoder.py", line 361, in raw_decode
obj, end = self.scan_once(s, idx)
~~~~~~~~~~~~~~^^^^^^^^
RecursionError: maximum recursion depth exceeded while decoding a JSON array from a unicode string
985025074
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
Projects
Status
Todo