[OE-core] [PATCH v2 07/19] python2 create_manifest.py: fix trailing whitespace in json

Tim Orling timothy.t.orling at linux.intel.com
Fri Dec 8 22:45:19 UTC 2017


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 at linux.intel.com>
---
 meta/recipes-devtools/python/python/create_manifest2.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/python/python/create_manifest2.py b/meta/recipes-devtools/python/python/create_manifest2.py
index bd64ec3ee74..e7450452ba5 100644
--- a/meta/recipes-devtools/python/python/create_manifest2.py
+++ b/meta/recipes-devtools/python/python/create_manifest2.py
@@ -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=(',', ': '))
-- 
2.13.6




More information about the Openembedded-core mailing list