[OE-core] [PATCH 1/9] lib/oe/patch: handle non-UTF8 encoding when reading patches

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Wed Sep 7 10:07:38 UTC 2016


Paul Eggleton <paul.eggleton at linux.intel.com> writes:

>> I would read the file as a binary ('rb' instead of 'r') and make the
>> GitApplyTree.* strings a 'bytes' type.
>
> The code is not just passing the data through, it is actually processing
> it.  If we did what you propose wouldn't it make that processing more
> difficult?

Should not be very much... You have to write b'foo' instead of 'foo' at
some places, but things like 'file.readline()' or 'line.startswith()'
are still working with 'bytes' resp. binary files.

Only when trying to print them on stdout, things can get nasty.  But
this should not be needed for patches.


Enrico
-- 
SIGMA Chemnitz GmbH       Registergericht:   Amtsgericht Chemnitz HRB 1750
Am Erlenwald 13           Geschaeftsfuehrer: Grit Freitag, Frank Pyritz
09128 Chemnitz



More information about the Openembedded-core mailing list