Message368823
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! |
|
Date |
User |
Action |
Args |
2020-05-14 10:35:58 | phr | set | recipients:
+ phr |
2020-05-14 10:35:58 | phr | set | messageid: <1589452558.91.0.037983714251.issue40623@roundup.psfhosted.org> |
2020-05-14 10:35:58 | phr | link | issue40623 messages |
2020-05-14 10:35:58 | phr | create | |
|