Message408273
I agree with Serhiy that in general the fact that json.tool crashes here is useful: similarly to an exception in Python code, it can inform the user that some data they feed to json.tool is invalid.
At the same time, I find it a bit obnoxious that the current implementation doesn't allow for the *final character* of the input to be a newline (or "characters" in case of \r\n... but it should still only ignore *a single effective newline*).
I mean, if the user starts spewing newlines in the middle of the file... that might easily be an error. If the file ends with 5 empty lines, that might easily be an error. But, if the file really is:
{'line': 1, 'data': ...}\n
{'line': 2, 'data': ...}\n
{'line': 3, 'data': ...}\n
I think that should be pragmatically accepted by json.tool, especially since many text editors now add newline characters at file ends. |
|
Date |
User |
Action |
Args |
2021-12-10 23:59:03 | lukasz.langa | set | recipients:
+ lukasz.langa, rhettinger, bob.ippolito, ezio.melotti, ZeD, serhiy.storchaka |
2021-12-10 23:59:03 | lukasz.langa | set | messageid: <1639180743.41.0.10735023968.issue45929@roundup.psfhosted.org> |
2021-12-10 23:59:03 | lukasz.langa | link | issue45929 messages |
2021-12-10 23:59:03 | lukasz.langa | create | |
|