]> code.ossystems Code Review - openembedded-core.git/commit
devtool: fix handling of unicode characters from subprocess stdout
authorJiajie Hu <jiajie.hu@intel.com>
Fri, 11 Nov 2016 06:02:18 +0000 (14:02 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 Nov 2016 11:02:33 +0000 (11:02 +0000)
commit1875ea92546d23abcab1b40b562477a0016f712d
treeee551a27e834f2f0daf65f94f9aefab527826697
parentd225558aefa8abe0e2d975a0b811a4d73b0ed563
devtool: fix handling of unicode characters from subprocess stdout

In previous implementation, a UnicodeDecodeError exception will be
raised if multi-byte encoded characters are printed by the subprocess.
As an example, the following command will fail in an en_US.UTF-8
environment because wget quotes its saving destination with '‘'(0xE2
0x80 0x98), while just the first byte is provided for decoding:

    devtool add recipe http://example.com/source.tar.xz

The patch fixes the issue by avoiding such kind of incomplete decoding.

Signed-off-by: Jiajie Hu <jiajie.hu@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/devtool/__init__.py