From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] support/scripts: fix graph-depends when run with python3
Date: Mon, 18 Apr 2016 11:35:06 +0200 [thread overview]
Message-ID: <20160418113506.7a6e4f16@free-electrons.com> (raw)
In-Reply-To: <1460929308-16094-1-git-send-email-s.martin49@gmail.com>
Hello,
On Sun, 17 Apr 2016 23:41:48 +0200, Samuel Martin wrote:
> 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 <module>
> 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 <s.martin49@gmail.com>
> ---
> support/scripts/graph-depends | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
prev parent reply other threads:[~2016-04-18 9:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-17 21:41 [Buildroot] [PATCH] support/scripts: fix graph-depends when run with python3 Samuel Martin
2016-04-17 22:32 ` Arnout Vandecappelle
2016-04-18 9:35 ` Thomas Petazzoni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160418113506.7a6e4f16@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox