From patchwork Sun Apr 17 21:41:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Martin X-Patchwork-Id: 611546 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 3qp4Vj0l8Mz9t5s for ; Mon, 18 Apr 2016 07:42:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=pqls5OIs; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3FCCF96061; Sun, 17 Apr 2016 21:42:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fIv5dkySYPYz; Sun, 17 Apr 2016 21:42:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id C7F18957C2; Sun, 17 Apr 2016 21:42:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 784631C0FFC for ; Sun, 17 Apr 2016 21:42:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 74436957C2 for ; Sun, 17 Apr 2016 21:42:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jtg1nJIPPXoi for ; Sun, 17 Apr 2016 21:42:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by hemlock.osuosl.org (Postfix) with ESMTPS id D9A76957BB for ; Sun, 17 Apr 2016 21:41:59 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id n3so99345367wmn.0 for ; Sun, 17 Apr 2016 14:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ZKUiYpxkjsOmHQUtsQ+nq+bEvj40R/ICJAu09hyGjpI=; b=pqls5OIsXGXLwRLjRfSdOvQW37Zkz014y3KbZoX9Nh26rs7BFByGr55q/nM5yIU6NU 7ydNzAld88v2zDFEBM4g36CU61DLU8tiYXjLcMLUeDXHGIxevyuasElPrHhYkLB1ENuQ XoGmFwniV/1xbZrqXrw8nCormhXwpMnI4aPeCoS7MzKrvgFLYb3sNVzFIk9tW7mx0Ios FisRdrhMA4sx7M5X77M+IWt3OcdKlGeq5vFW516k4fHYDSHx4D5i6yBLqC0q2B3f9GII LgWXWWXtg+Sh75fpTsSj+yxsT5cZ5z0Zai2siqhEDRLimF3m6sIyfBZgexLhjkIeJva4 Rbmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZKUiYpxkjsOmHQUtsQ+nq+bEvj40R/ICJAu09hyGjpI=; b=WcuvW2LiN3EwFuLbWYl75Ffcu5JTGvNRwH6rbPLJz9BqiRl5lF4wuG4vO/itkWo2zM AqHbMi8ryK8uSUMbuSprbj1dfTN3xl75YHZvNv4Ohf5K3qFPxtoT4W25OsyhJw/qJE3o c3ctSgLQZ/TauhP8vzm2YUjbw7E7FyjdVpFJNQIra8sZ6++SVFeFOS7l7kPfyOcZaPLC LEFksGT5Voi8jPhyW4scjpzsVOOa36cFi06heIrBMNeDPDlTXHdKtbA/lP2eWvjpat8G r+gYkC44rW2724sS+2ZApg5OYUm0WP+GwpSthGwBqkLt2r3KNWTCD4t79yUjdwIHEYx0 JO0g== X-Gm-Message-State: AOPr4FX5Fkwg0YwsVmxBI5NfX6XK1SPxse2kdWC4LEPGTe0SArCeqZYQ+js6qQq7V+SMgw== X-Received: by 10.28.85.137 with SMTP id j131mr14580063wmb.15.1460929318541; Sun, 17 Apr 2016 14:41:58 -0700 (PDT) Received: from bobook.localdomain (ivr94-4-82-229-165-48.fbx.proxad.net. [82.229.165.48]) by smtp.gmail.com with ESMTPSA id n3sm60622242wja.6.2016.04.17.14.41.56 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Apr 2016 14:41:57 -0700 (PDT) From: Samuel Martin To: buildroot@buildroot.org Date: Sun, 17 Apr 2016 23:41:48 +0200 Message-Id: <1460929308-16094-1-git-send-email-s.martin49@gmail.com> X-Mailer: git-send-email 2.8.0 Subject: [Buildroot] [PATCH] support/scripts: fix graph-depends when run with python3 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Make graph-depends script opening the output file in text mode since only ascii characters will be written. This change fixes the following error occuring when the default host python interpreter is python3: make: Entering directory '/opt/buildroot' Getting targets Getting dependencies for ['toolchain-external', 'toolchain', 'busybox', ...] Getting dependencies for ['host-python3', 'host-pkgconf', 'host-gettext', ...] Getting dependencies for ['host-libxml2', 'host-swig', 'host-m4', ...] Getting version for ['toolchain-external', 'toolchain', 'busybox', ...] Traceback (most recent call last): File "/opt/buildroot/support/scripts/graph-depends", line 425, in outfile.write("digraph G {\n") TypeError: a bytes-like object is required, not 'str' Makefile:807: recipe for target 'graph-depends' failed make[1]: *** [graph-depends] Error 1 Makefile:84: recipe for target '_all' failed make: *** [_all] Error 2 make: Leaving directory '/opt/buildroot' While with python2, adding 'b' to the openning mode has no effect on Linux (c.f. [2]), the above error is expected with python3 (c.f. [1]). Therefore, just open the outfile in default (i.e. text) mode. [1] https://docs.python.org/3/library/functions.html#open [2] https://docs.python.org/2/library/functions.html#open Signed-off-by: Samuel Martin Acked-by: Arnout Vandecappelle (Essensium/Mind) --- support/scripts/graph-depends | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends index a00eb9d..cb00383 100755 --- a/support/scripts/graph-depends +++ b/support/scripts/graph-depends @@ -73,7 +73,7 @@ else: if check_only: sys.stderr.write("don't specify outfile and check-only at the same time\n") sys.exit(1) - outfile = open(args.outfile, "wb") + outfile = open(args.outfile, "w") if args.package is None: mode = MODE_FULL