This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: JSONDecodeError: Extra Data Raised on Long Valid JSON
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: UnknownRetiredGuy, ezio.melotti, rhettinger, ronaldoussoren
Priority: normal Keywords:

Created on 2021-04-11 12:25 by UnknownRetiredGuy, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
pico-hard.json UnknownRetiredGuy, 2021-04-11 12:25 Long Vaild JSON
Messages (2)
msg390781 - (view) Author: Unknown Retired Guy (UnknownRetiredGuy) Date: 2021-04-11 12:25
https://i.ibb.co/tYqBsQ8/pico-hard.png

That JSONDecodeError: Extra Data is raised when the Valid JSON is too long or over than 25000 bytes, I don't know what caused this, can you fix it?

The code and the traceback is in that picture/link above in this comment and the long valid JSON is provided here.

The Below picture/link proof that it's a valid JSON:
https://i.ibb.co/fGytRFC/946.png
msg390783 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2021-04-11 13:37
There is a block of NUL bytes at the end of the JSON data structure

The output of "od -c pico-hard.json" ends with:

0046340    s   e   c   t   i   o   n   N   o   t   e   s   "   :   [   ]
0046360    ,   "   t   y   p   e   O   f   S   e   c   t   i   o   n   "
0046400    :   0   }   ]   }  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
0046420   \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
0071600   \0  \0  \0  \0  \0  \0  \0  \0  \0                            
0071611


Note that there is a block of "\0" entries after the closing "}". 

The file can be parsed correctly after stripping these NUL bytes.
History
Date User Action Args
2022-04-11 14:59:44adminsetgithub: 87973
2021-04-16 20:24:29terry.reedysetnosy: + rhettinger, ezio.melotti
2021-04-11 13:37:45ronaldoussorensetnosy: + ronaldoussoren
messages: + msg390783
2021-04-11 12:25:48UnknownRetiredGuycreate