[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tools/misc/xencov_split: Add python 3 compatibility



Hi,

On Mon, Sep 04, 2023 at 08:51:31AM +0200, Jan Beulich wrote:
> On 02.09.2023 18:21, Javi Merino wrote:
> > Closes #154
> > 
> > Signed-off-by: Javi Merino <javi.merino@xxxxxxxxx>
> 
> The title isn't really in line with ...
> 
> > --- a/tools/misc/xencov_split
> > +++ b/tools/misc/xencov_split
> > @@ -1,5 +1,7 @@
> > -#!/usr/bin/env python
> > +#!/usr/bin/env python3
> 
> ... this part of the change, and making Py3 a requirement here (assuming
> that's indeed necessary) surely wants adding a few words as description.
> Grep-ing the tools/ sub-tree I notice that so far we've avoided explicit
> uses of "python3", and I assume we would better continue doing so as on
> a distro with only Py3 a "python3" alias may legitimately not exist.
> 
> Jan
> 
The only credible reason for doing that would be to have scripts compatible
with both python2 and python3. Python2 has been deprecated since 2020 and
it's no longer security supported[1]. No one should be even remotely
encouraged to use that interpreter. The libs it uses are also in similar
positions. The recommended approach is to migrate as much as possible to
python3 and live happily ever after.

On that topic, the official PEP states:

(From https://peps.python.org/pep-0394/)

  Some Linux distributions will not provide a python command at all by
  default, but will provide a python3 command by default.

Which seems to imply the correct shebang is indeed `/usr/bin/env python3`

Thanks,
Alejandro



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.