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.

Author phr
Recipients phr
Date 2020-05-14.10:35:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589452558.91.0.037983714251.issue40623@roundup.psfhosted.org>
In-reply-to
Content
This is a well-explored issue in other contexts: https://en.wikipedia.org/wiki/JSON_streaming

There is also a patch for it in json.tool, for release in 3.9: https://bugs.python.org/issue31553

Basically it's often convenient to have a file containing a list of json docs, one per line.  However, there is no convenient way to read them back in one by one, since json.load(filehandle) barfs when it sees the unexpected newline at the end of the first doc.

It would be great if the json module itself had a function to handle this.  I have an awful hack that I use myself, that is not suitable for a production library, but I'll attach it to show what functionality I'm suggesting.  I hope this is simple enough to not need a PEP.  Thanks!
History
Date User Action Args
2020-05-14 10:35:58phrsetrecipients: + phr
2020-05-14 10:35:58phrsetmessageid: <1589452558.91.0.037983714251.issue40623@roundup.psfhosted.org>
2020-05-14 10:35:58phrlinkissue40623 messages
2020-05-14 10:35:58phrcreate