Message ID | 20190518040054.230179-10-sjg@chromium.org |
---|---|
State | Accepted |
Commit | 2ab6e13e014c065a6168d31d6b8aeca135767816 |
Delegated to: | Simon Glass |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jnY3I1zj"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 455WpL6Dzlz9s4Y for <incoming@patchwork.ozlabs.org>; Sat, 18 May 2019 14:07:38 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 80267C21DA1; Sat, 18 May 2019 04:06:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E814BC21E31; Sat, 18 May 2019 04:01:41 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0E9B3C21E1D; Sat, 18 May 2019 04:01:28 +0000 (UTC) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by lists.denx.de (Postfix) with ESMTPS id DC5DAC21DFB for <u-boot@lists.denx.de>; Sat, 18 May 2019 04:01:23 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id x24so7067763ion.5 for <u-boot@lists.denx.de>; Fri, 17 May 2019 21:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a31BS+TDoGaU+TL4GcO9H707UaTr73mbjut+7SpAE2o=; b=jnY3I1zjoadYdwrZ1dKTECyKUTch0buIOx7r6j6ueT9fnHbl9UrgQpMGgGJkEzYqGf ptttvkwdsc1qUrgQ1VgFmhuSUXqOI6VbgVllC23nO9xcRor8tDAb3ecDCITnRnU99dw7 7vk8XDRaVldjbsHUPnbN9Vi9Drifs57PXJmg0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a31BS+TDoGaU+TL4GcO9H707UaTr73mbjut+7SpAE2o=; b=syE2wxfI6s6S4U4e3/M44ixncC1IWc6RQoQZX5RGEmlffopx0WSj1v/G7PSRnrji9P S75zG13bKZneMgUT6cuIPG7j7OGn2iZBWKyFj8VCR6nCuckDlHJ4REY6N75ztYZhRRr7 MHYF11bU6suTfvZUhacs0vDCWURnwUzjENqhEhDitPeR3rMShDBdak8RjvfozoVxWjms 875nKi21nVi/WWnPdQqYXYVloUf5Lt9sIC7qWYe4hYHaajzsI76ZqZRMymX6cDm8s8QB IIaHgNTMAhdLTrlgZjZO4OikrcAwEctTr0VDIhuQp5GD8FMSvVeO1sHDMX7QGzGz+8/m J1Cw== X-Gm-Message-State: APjAAAXMsdDJ4GEey8LZrD7j3N8RarfSLJP86qVbBzPKl8CLdsNCEf6f do3WLq2WE37aNxsv+S58ZPnmMZn82kA= X-Google-Smtp-Source: APXvYqza1lUE8q5FENOVqcvPlfYsJRcUoij0RZBZFbSrE1Mk6knbeHD8kwaeDj9oEElzborQP2cp0g== X-Received: by 2002:a5e:8217:: with SMTP id l23mr8559824iom.84.1558152082777; Fri, 17 May 2019 21:01:22 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id e7sm1284986itc.44.2019.05.17.21.01.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2019 21:01:22 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Date: Fri, 17 May 2019 22:00:39 -0600 Message-Id: <20190518040054.230179-10-sjg@chromium.org> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog In-Reply-To: <20190518040054.230179-1-sjg@chromium.org> References: <20190518040054.230179-1-sjg@chromium.org> MIME-Version: 1.0 Cc: Tom Rini <trini@konsulko.com> Subject: [U-Boot] [PATCH 09/24] dtoc: Use binary mode for reading files X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
Series |
binman: dtoc: Convert to Python 3
|
expand
|
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index 3cd34b745ed..4c39f9a3e28 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -85,13 +85,13 @@ class TestFdt(unittest.TestCase): def testFlush(self): """Check that we can flush the device tree out to its file""" fname = self.dtb._fname - with open(fname) as fd: + with open(fname, 'rb') as fd: data = fd.read() os.remove(fname) with self.assertRaises(IOError): - open(fname) + open(fname, 'rb') self.dtb.Flush() - with open(fname) as fd: + with open(fname, 'rb') as fd: data = fd.read() def testPack(self):
The .dtb files are binary so we should open them as binary files. This allows Python 3 to use the correct 'bytes' type. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/dtoc/test_fdt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)