New submission from paul rubin <phr-pythonb...@nightsong.com>:

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!

----------
components: Library (Lib)
files: jsonstream.py
messages: 368823
nosy: phr
priority: normal
severity: normal
status: open
title: JSON streaming
type: enhancement
Added file: https://bugs.python.org/file49153/jsonstream.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40623>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to