diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-20 11:17:05 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:00 +0100 |
commit | a7309d5790f5dac46e84d3c14959943eb2496fda (patch) | |
tree | 48e1fcb886b8ef2974bade09694356f3230fb8a8 /meta/classes/package.bbclass | |
parent | 297438e965053b2eb56cc8ef3e59465642f10a24 (diff) | |
download | poky-a7309d5790f5dac46e84d3c14959943eb2496fda.tar.gz |
classes/lib: Update to use python3 command pipeline decoding
In python3, strings are unicode by default. We need to encode/decode
from command pipelines and other places where we interface with the
real world using the correct locales. This patch updates various
call sites to use the correct encoding/decodings.
(From OE-Core rev: bb4685af1bffe17b3aa92a6d21398f38a44ea874)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r-- | meta/classes/package.bbclass | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index a4125a0e98..501004ed48 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -63,7 +63,7 @@ def legitimize_package_name(s): | |||
63 | def fixutf(m): | 63 | def fixutf(m): |
64 | cp = m.group(1) | 64 | cp = m.group(1) |
65 | if cp: | 65 | if cp: |
66 | return ('\u%s' % cp).decode('unicode_escape').encode('utf-8') | 66 | return ('\\u%s' % cp).encode('latin-1').decode('unicode_escape') |
67 | 67 | ||
68 | # Handle unicode codepoints encoded as <U0123>, as in glibc locale files. | 68 | # Handle unicode codepoints encoded as <U0123>, as in glibc locale files. |
69 | s = re.sub('<U([0-9A-Fa-f]{1,4})>', fixutf, s) | 69 | s = re.sub('<U([0-9A-Fa-f]{1,4})>', fixutf, s) |
@@ -1259,8 +1259,8 @@ python emit_pkgdata() { | |||
1259 | def write_if_exists(f, pkg, var): | 1259 | def write_if_exists(f, pkg, var): |
1260 | def encode(str): | 1260 | def encode(str): |
1261 | import codecs | 1261 | import codecs |
1262 | c = codecs.getencoder("string_escape") | 1262 | c = codecs.getencoder("unicode_escape") |
1263 | return c(str)[0] | 1263 | return c(str)[0].decode("latin1") |
1264 | 1264 | ||
1265 | val = d.getVar('%s_%s' % (var, pkg), True) | 1265 | val = d.getVar('%s_%s' % (var, pkg), True) |
1266 | if val: | 1266 | if val: |