Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] [PATCH lttng-ust] Fix: Corrected python version assumptions in lttng-gen-tp
       [not found]   ` <DUB123-W18FF6C4DAEAEC5A2346C92DD650@phx.gbl>
@ 2014-03-25 19:20     ` Mathieu Desnoyers
  2014-03-27  7:57       ` [lttng-dev] [PATCH v2 lttng-ust] Fix: python invocation through env jderehag
  0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Desnoyers @ 2014-03-25 19:20 UTC (permalink / raw)


----- Original Message -----
> From: "Jesper Derehag" <jderehag@hotmail.com>
> To: "Mathieu Desnoyers" <mathieu.desnoyers at efficios.com>
> Cc: lttng-dev at lists.lttng.org
> Sent: Tuesday, March 25, 2014 2:03:53 PM
> Subject: RE: [lttng-dev] [PATCH lttng-ust] Fix: Corrected python version assumptions in lttng-gen-tp
> 
> > Date: Tue, 25 Mar 2014 14:16:02 +0000
> > From: mathieu.desnoyers@efficios.com
> > To: jderehag at hotmail.com
> > CC: lttng-dev at lists.lttng.org
> > Subject: Re: [lttng-dev] [PATCH lttng-ust] Fix: Corrected python version
> > 	assumptions in lttng-gen-tp
> > 
> > ----- Original Message -----
> >> From: jderehag@hotmail.com
> >> To: lttng-dev at lists.lttng.org
> >> Cc: "Jesper Derehag" <jderehag at hotmail.com>
> >> Sent: Monday, March 24, 2014 10:29:44 AM
> >> Subject: [lttng-dev] [PATCH lttng-ust] Fix: Corrected python version
> >> 	assumptions in lttng-gen-tp
> >> 
> >> From: Jesper Derehag <jderehag@hotmail.com>
> >> 
> >> This modification calls the interpreter through env instead of
> >> directly, which should be more portable for those distros which do not
> >> install
> >> python into /usr/bin/.
> >> 
> >> Also, since lttng-gen-tp is not python2 compatible, I changed it to
> >> strictly
> >> call python3 which is the recommended way.
> >> See PEP 394.
> >> http://legacy.python.org/dev/peps/pep-0394/
> > 
> > Hi Jesper,
> > 
> > I somehow thought that lttng-gen-tp was meant to work with
> > Python 2.7 and Python 3. But maybe I'm missing something.
> > Where have you seen the dependency of this script on python
> > 3 in our docs ?
> > 
> > Thanks,
> > 
> > Mathieu
> 
> Hmm... The reason for why I changed into python3 was due to that I got syntax
> error when trying to run it:
> -----
> ./lttng-gen-tp
> ? File "./lttng-gen-tp", line 100
> ? ? except OSError as msg:
> ? ? ? ? ? ? ? ? ? ? ^
> SyntaxError: invalid syntax
> ------
> I *thought* I was running on python2.7 but as it turns out I was not.
> When resolving "python" I get python2.7 but when I check the explicit version
> laying at /usr/bin/python its actually a 2.4 version so no wonder it was
> failing.
> 
> Checking the PEP for when "except XX as yy" was introduced points to that it
> was introduced in python 2.6 so entirely my mistake.
> Reran it now with the a 2.7 version and it works as intended.
> 
> However, I still think you should run it through env as proposed in the patch
> and not use the explicit path to python.
> 
> If you agree, do you want me to send you another patch removing the "3"?

Yes, if you can do that it would be perfect!

> 
> Otherwise, I apologize for my blunder.

No worries! This is why we have code review :) Pinpointing
an issue and submitting a patch as well, even if imperfect,
does a lot to improve LTTng!

Thanks,

Mathieu

> 
> Regards,
> Jesper
> 
> > 
> > 
> >> ---
> >> tools/lttng-gen-tp | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >> 
> >> diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp
> >> index c49e8a5..c7bf295 100755
> >> --- a/tools/lttng-gen-tp
> >> +++ b/tools/lttng-gen-tp
> >> @@ -1,4 +1,4 @@
> >> -#!/usr/bin/python
> >> +#!/usr/bin/env python3
> >> #
> >> # Copyright (c) 2012 Yannick Brosseau <yannick.brosseau at gmail.com>
> >> #
> >> --
> >> 1.7.9.5
> >> 
> >> 
> >> _______________________________________________
> >> lttng-dev mailing list
> >> lttng-dev at lists.lttng.org
> >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >> 
> > 
> > --
> > Mathieu Desnoyers
> > EfficiOS Inc.
> > http://www.efficios.com

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [lttng-dev] [PATCH v2 lttng-ust] Fix: python invocation through env
  2014-03-25 19:20     ` [lttng-dev] [PATCH lttng-ust] Fix: Corrected python version assumptions in lttng-gen-tp Mathieu Desnoyers
@ 2014-03-27  7:57       ` jderehag
  0 siblings, 0 replies; 2+ messages in thread
From: jderehag @ 2014-03-27  7:57 UTC (permalink / raw)


From: Jesper Derehag <jderehag@hotmail.com>

This modification calls the interpreter through env instead of
directly, which should be more portable for those distros which do not install
python into /usr/bin/.
---
 tools/lttng-gen-tp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp
index c49e8a5..a3a01f2 100755
--- a/tools/lttng-gen-tp
+++ b/tools/lttng-gen-tp
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # Copyright (c)  2012 Yannick Brosseau <yannick.brosseau at gmail.com>
 #
-- 
1.7.9.5




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-27  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1395671384-24750-1-git-send-email-jderehag@hotmail.com>
     [not found] ` <654526496.119.1395756962956.JavaMail.zimbra@efficios.com>
     [not found]   ` <DUB123-W18FF6C4DAEAEC5A2346C92DD650@phx.gbl>
2014-03-25 19:20     ` [lttng-dev] [PATCH lttng-ust] Fix: Corrected python version assumptions in lttng-gen-tp Mathieu Desnoyers
2014-03-27  7:57       ` [lttng-dev] [PATCH v2 lttng-ust] Fix: python invocation through env jderehag

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox