[Piglit] [PATCH 1/2] framework: handle UnicodeDecodeError

Dylan Baker dylan at pnwbakers.com
Mon Feb 6 22:57:35 UTC 2017


Quoting Marek Olšák (2017-02-06 14:39:03)
> On Mon, Feb 6, 2017 at 11:10 PM, Dylan Baker <dylan at pnwbakers.com> wrote:
> > I'm curious when you're hitting this because while this works around the problem
> > it's not really fixing it, and I'd really like to fix it correctly.
> 
> I don't remember. I guess the stdout/stderr output contained some
> characters that python couldn't accept. For example, the LLVM
> assembler prints errors to stdout/stderr with colors.
> 
> Marek

Interesting. Maybe the better thing to do then is to set the 'errors' flag of
bytes.decode to 'replace':

out.decode(encoding='utf-8', errors='replace')

Which would just take things it can't decode and use the � character. Does that
sound like a better plan since it would give a result other than crash?

Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20170206/f6a8b956/attachment.sig>


More information about the Piglit mailing list