[OE-core] [PATCH] devtool: fix handling of unicode characters from subprocess stdout
Burton, Ross
ross.burton at intel.com
Fri Nov 11 12:22:25 UTC 2016
On 11 November 2016 at 06:02, Jiajie Hu <jiajie.hu at intel.com> wrote:
> + reader = codecs.getreader('utf-8')(process.stdout)
> buf = ''
> while True:
> - out = process.stdout.read(1)
> - out = out.decode('utf-8')
> + out = reader.read(1, 1)
>
A reader is definitely the right thing here, but I'm wondering why this
needs to loop on single characters. As I understand it doing a read() on a
reader wrapping stdout will read until it blocks (because the process
hasn't got anything to output) so result in less pointless iterating.
Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20161111/6dff78a2/attachment-0002.html>
More information about the Openembedded-core
mailing list