From: Simon Glass Date: Tue, 14 May 2019 15:53:43 -0600 Subject: [U-Boot] [PATCH 09/21] tools: dtoc: Open all binary files in binary mode In-Reply-To: <20190514215355.246399-1-sjg@chromium.org> References: <20190514215355.246399-1-sjg@chromium.org> Message-ID: <20190514215355.246399-10-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Fix an open() statement to use binary mode, so that it works as expected with Python 3. Signed-off-by: Simon Glass --- tools/dtoc/fdt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py index 9ad72f89ec..031b3a0084 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 -- 2.21.0.1020.gf2820cf01a-goog