From 30d02e2aa2d42fdf76271234b2dc9f37bc46b250 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 18 May 2016 21:57:23 +0300 Subject: 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. Signed-off-by: Ed Bartosh --- scripts/lib/recipetool/create.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/lib/recipetool/create.py') 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): continue # Squash spaces, and replace smart quotes, double quotes # and backticks with single quotes - line = oe.utils.squashspaces(line.strip()).decode("utf-8") + line = oe.utils.squashspaces(line.strip()) line = line.replace(u"\u2018", "'").replace(u"\u2019", "'").replace(u"\u201c","'").replace(u"\u201d", "'").replace('"', '\'').replace('`', '\'') if line: lictext.append(line) m = hashlib.md5() try: - m.update(' '.join(lictext)) + m.update(' '.join(lictext).encode('utf-8')) md5val = m.hexdigest() except UnicodeEncodeError: md5val = None -- cgit 1.2.3-korg