[U-Boot] [PATCH v2 6/8] test/py: fit: Open files as binary files

Simon Glass sjg at chromium.org
Tue Jul 10 20:57:06 UTC 2018


On 14 September 2017 at 15:34, Paul Burton <paul.burton at imgtec.com> wrote:
> The read_file() function in test_fit is used with files that are not
> text files, as well as some that are. It is never used in a way that
> requires it to decode text files to characters, so open all files in
> binary mode such that read() doesn't attempt to decode characters for
> files which are not text files.
>
> Without this test_fit fails on python 3.x when reading an FDT in
> run_fit_test() with:
>
>   UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position
>                        0: invalid continuation byte
>
> Signed-off-by: Paul Burton <paul.burton at imgtec.com>
> Reviewed-by: Stephen Warren <swarren at nvidia.com>
> ---
>
> Changes in v2: None
>
>  test/py/tests/test_fit.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list