]> code.ossystems Code Review - openembedded-core.git/commitdiff
python2 create_manifest.py: fix trailing whitespace in json
authorTim Orling <timothy.t.orling@linux.intel.com>
Tue, 28 Nov 2017 14:35:31 +0000 (06:35 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 20 Jan 2018 22:31:10 +0000 (22:31 +0000)
The json.dumps function adds trailing whitespace when using
indent, because the default separator is not ','.

The workaround [1] is to set the separators to be ',' and ': ',
e.g. separators=(',', ': ')

[1] https://hg.python.org/cpython/rev/78bad589f205

Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-devtools/python/python/create_manifest2.py

index bd64ec3ee743227ff1392a8d8709bfe68cdb651e..e7450452ba57cee129acb5b1c7d13d7f5bc21fd7 100644 (file)
@@ -274,4 +274,4 @@ for key in new_manifest:
 
 # Create the manifest from the data structure that was built
 with open('python2-manifest.json.new','w') as outfile:
-    json.dump(new_manifest,outfile,sort_keys=True, indent=4)
+    json.dump(new_manifest,outfile,sort_keys=True, indent=4, separators=(',', ': '))