summaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-05-18 21:57:23 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:24:01 +0100
commit3ee70cb7259aad3b53e51884ec5b9122e804d77e (patch)
treefe11513a46170019cdd674002c6cc5b2045b762a /scripts/lib/recipetool/create.py
parented7abe6b9a2ff81d320e7c63841487d37e61b5a5 (diff)
downloadpoky-3ee70cb7259aad3b53e51884ec5b9122e804d77e.tar.gz
scripts: Fix encoding errors for python3
Moved call of decode('utf-8') as close as possible to call of subprocess API to avoid calling it in a lot of other places. Decoded binary data to utf-8 where appropriate to fix devtool and recipetool tests in python 3 environment. (From OE-Core rev: 30d02e2aa2d42fdf76271234b2dc9f37bc46b250) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool/create.py')
-rw-r--r--scripts/lib/recipetool/create.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index e3e01e385a..744ff1b0ab 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -851,14 +851,14 @@ def crunch_license(licfile):
851 continue 851 continue
852 # Squash spaces, and replace smart quotes, double quotes 852 # Squash spaces, and replace smart quotes, double quotes
853 # and backticks with single quotes 853 # and backticks with single quotes
854 line = oe.utils.squashspaces(line.strip()).decode("utf-8") 854 line = oe.utils.squashspaces(line.strip())
855 line = line.replace(u"\u2018", "'").replace(u"\u2019", "'").replace(u"\u201c","'").replace(u"\u201d", "'").replace('"', '\'').replace('`', '\'') 855 line = line.replace(u"\u2018", "'").replace(u"\u2019", "'").replace(u"\u201c","'").replace(u"\u201d", "'").replace('"', '\'').replace('`', '\'')
856 if line: 856 if line:
857 lictext.append(line) 857 lictext.append(line)
858 858
859 m = hashlib.md5() 859 m = hashlib.md5()
860 try: 860 try:
861 m.update(' '.join(lictext)) 861 m.update(' '.join(lictext).encode('utf-8'))
862 md5val = m.hexdigest() 862 md5val = m.hexdigest()
863 except UnicodeEncodeError: 863 except UnicodeEncodeError:
864 md5val = None 864 md5val = None