diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-05-18 21:57:23 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:01 +0100 |
commit | 3ee70cb7259aad3b53e51884ec5b9122e804d77e (patch) | |
tree | fe11513a46170019cdd674002c6cc5b2045b762a /meta | |
parent | ed7abe6b9a2ff81d320e7c63841487d37e61b5a5 (diff) | |
download | poky-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 'meta')
-rw-r--r-- | meta/lib/oe/patch.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index a25fd527f6..4a0d3f7149 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py | |||
@@ -292,7 +292,10 @@ class GitApplyTree(PatchTree): | |||
292 | def decodeAuthor(line): | 292 | def decodeAuthor(line): |
293 | from email.header import decode_header | 293 | from email.header import decode_header |
294 | authorval = line.split(':', 1)[1].strip().replace('"', '') | 294 | authorval = line.split(':', 1)[1].strip().replace('"', '') |
295 | return decode_header(authorval)[0][0] | 295 | result = decode_header(authorval)[0][0] |
296 | if hasattr(result, 'decode'): | ||
297 | result = result.decode('utf-8') | ||
298 | return result | ||
296 | 299 | ||
297 | @staticmethod | 300 | @staticmethod |
298 | def interpretPatchHeader(headerlines): | 301 | def interpretPatchHeader(headerlines): |