From: Stefan Lengfeld <contact@stefanchrist.eu>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] docs: add python version in shebang
Date: Wed, 18 Sep 2019 21:25:40 +0200 [thread overview]
Message-ID: <20190918192540.j7eeju6diit7ug3w@porty> (raw)
In-Reply-To: <20190917080126.2sp36vixvfvlmvtk@pengutronix.de>
Hi Uwe,
On Tue, Sep 17, 2019 at 10:01:26AM +0200, Uwe Kleine-König wrote:
> Hello Stefan,
>
> On Sun, Sep 15, 2019 at 09:31:14PM +0200, Stefan Lengfeld wrote:
> > On my machine 'make docs' fails with
> >
> > Traceback (most recent call last):
> > File "/home/stc/git/barebox/Documentation/gen_commands.py", line 156, in <module>
> > parse_c(source)
> > File "/home/stc/git/barebox/Documentation/gen_commands.py", line 34, in parse_c
> > for line in file(name, 'r'):
> > NameError: name 'file' is not defined
> >
> > because /usr/bin/python points to python3 instead of python2. Fix this
> > by including the language version in the shebang of the script.
>
> It would be much preferable to convert this code to Python3. I looked
> into that and it wasn't that hard to even make it compatible to both
> Python 2 and Python 3. (One downside is that Python 3 is more picky
> about file encodings, so I have to insert a patch that converts the few
> latin1 file left in the tree to utf-8 first. But as this is a good thing
> on its own (IMHO) that's not too bad.)
>
> Find the two patches in reply to this mail.
Indeed, converting the script to support Python 2 and 3 at the same time
is the better fix.
Tested-By: Stefan Lengfeld <contact@stefanchrist.eu>
Kind regards,
Stefan
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2019-09-18 19:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-15 19:31 Stefan Lengfeld
2019-09-17 8:01 ` Uwe Kleine-König
2019-09-17 8:02 ` [PATCH 1/2] Convert latin1 files to utf-8 Uwe Kleine-König
2019-09-17 10:47 ` Sascha Hauer
2019-09-17 8:09 ` [PATCH 2/2] Documentation: make gen_commands helper python3 compatible Uwe Kleine-König
2019-09-17 8:33 ` Uwe Kleine-König
2019-09-18 19:25 ` Stefan Lengfeld [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=20190918192540.j7eeju6diit7ug3w@porty \
--to=contact@stefanchrist.eu \
--cc=barebox@lists.infradead.org \
--cc=u.kleine-koenig@pengutronix.de \
/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