[CRIU] [PATCH 5/6] test: make crit-recode.py python2/python3 compatible

Andrei Vagin avagin at virtuozzo.com
Sat Jun 2 01:24:14 MSK 2018


On Wed, May 30, 2018 at 09:09:42PM +0200, Adrian Reber wrote:
> On Wed, May 30, 2018 at 09:39:38PM +0300, Andrei Vagin wrote:
> > Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
> > ---
> >  test/crit-recode.py | 43 +++++++++++++++++++++++--------------------
> >  1 file changed, 23 insertions(+), 20 deletions(-)
> > 
> > diff --git a/test/crit-recode.py b/test/crit-recode.py
> > index 0d4b31777..0cb3341d3 100755
> > --- a/test/crit-recode.py
> > +++ b/test/crit-recode.py
> > @@ -1,9 +1,11 @@
> > -#!/bin/env python2
> > +#!/usr/bin/env python
> 
> I understand what and why you are doing this but I just wanted to
> mention that this is rather the opposite from what I heard should be
> done. I am not a python expert so I am just repeating what I heard
> elsewhere and I think the Fedora packaging guidelines are also
> mentioning it.
> 
> It is better to explicitly use python2 or python3, especially as I
> understand it, the python binary should never be python3 and one should
> avoid the use of an unversioned python binary.
> 
> I understand that it makes it easier to run it in travis either with
> python2 or python3 by changing the link like you did in the other
> commit. Maybe our scripts should not include a shebang at all and always
> be called with the corresponding interpreter. So either 'python2
> test/crit-recode.py' or 'python3 test/crit-recode.py'.
> 
> This is in no way important to me, I just wanted to mention it as I had
> the same problem with crit.

I understand your points and I'm agree that we need to follow them for
crit, because it is a public tool. For test tools like zdtm.py and other
test scripts, I think we can avoid these tricks before we meet any
problem. Let me know if you don't afree with this.

> 
> 		Adrian


More information about the CRIU mailing list