From: Simon Glass Date: Tue, 14 May 2019 21:53:43 +0000 (-0600) Subject: tools: dtoc: Open all binary files in binary mode X-Git-Tag: v2019.10-rc1~32^2~65 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e4b51e8d6dc86c0ea80552a1d2e19756b19e4a1;p=platform%2Fkernel%2Fu-boot.git tools: dtoc: Open all binary files in binary mode Fix an open() statement to use binary mode, so that it works as expected with Python 3. Signed-off-by: Simon Glass --- diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py index 9ad72f8..031b3a0 100644 --- a/tools/dtoc/fdt.py +++ b/tools/dtoc/fdt.py @@ -469,7 +469,7 @@ class Fdt: if self._fname: self._fname = fdt_util.EnsureCompiled(self._fname) - with open(self._fname) as fd: + with open(self._fname, 'rb') as fd: self._fdt_obj = libfdt.Fdt(fd.read()) @staticmethod