#16476: Fix json.tool to avoid including trailing whitespace.
This commit is contained in:
parent
057bcb4c6c
commit
b32512ed9a
|
@ -31,7 +31,8 @@ def main():
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
raise SystemExit(e)
|
raise SystemExit(e)
|
||||||
with outfile:
|
with outfile:
|
||||||
json.dump(obj, outfile, sort_keys=True, indent=4)
|
json.dump(obj, outfile, sort_keys=True,
|
||||||
|
indent=4, separators=(',', ': '))
|
||||||
outfile.write('\n')
|
outfile.write('\n')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,19 +19,19 @@ class TestTool(unittest.TestCase):
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
"blorpie"
|
"blorpie"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"whoops"
|
"whoops"
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
"d-shtaeou",
|
"d-shtaeou",
|
||||||
"d-nthiouh",
|
"d-nthiouh",
|
||||||
"i-vhbjkhnth",
|
"i-vhbjkhnth",
|
||||||
{
|
{
|
||||||
"nifty": 87
|
"nifty": 87
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"field": "yes",
|
"field": "yes",
|
||||||
"morefield": false
|
"morefield": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -167,6 +167,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #16476: Fix json.tool to avoid including trailing whitespace.
|
||||||
|
|
||||||
- Issue #16549: Make json.tool work again on Python 3 and add tests.
|
- Issue #16549: Make json.tool work again on Python 3 and add tests.
|
||||||
Initial patch by Berker Peksag and Serhiy Storchaka.
|
Initial patch by Berker Peksag and Serhiy Storchaka.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue