summaryrefslogtreecommitdiff
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-20 11:17:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:10:02 +0100
commitbb4685af1bffe17b3aa92a6d21398f38a44ea874 (patch)
treeba3f00918c63d4a3902e626c110f48aa42d72039 /meta/classes/package.bbclass
parent737a095fcde773a36e0fee1f27b74aaa88062386 (diff)
downloadopenembedded-core-bb4685af1bffe17b3aa92a6d21398f38a44ea874.tar.gz
openembedded-core-bb4685af1bffe17b3aa92a6d21398f38a44ea874.tar.bz2
openembedded-core-bb4685af1bffe17b3aa92a6d21398f38a44ea874.zip
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass6
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):
def fixutf(m):
cp = m.group(1)
if cp:
- return ('\u%s' % cp).decode('unicode_escape').encode('utf-8')
+ return ('\\u%s' % cp).encode('latin-1').decode('unicode_escape')
# Handle unicode codepoints encoded as <U0123>, as in glibc locale files.
s = re.sub('<U([0-9A-Fa-f]{1,4})>', fixutf, s)
@@ -1259,8 +1259,8 @@ python emit_pkgdata() {
def write_if_exists(f, pkg, var):
def encode(str):
import codecs
- c = codecs.getencoder("string_escape")
- return c(str)[0]
+ c = codecs.getencoder("unicode_escape")
+ return c(str)[0].decode("latin1")
val = d.getVar('%s_%s' % (var, pkg), True)
if val: