Re: #! /usr/bin/python{,3} -Es

2012-10-28 Thread Barry Warsaw
On Oct 27, 2012, at 06:53 PM, Jakub Wilk wrote: >* Thomas Kluyver , 2012-10-26, 11:03: >>Are there any situations where you might want to run a system script >with >>modified Python environment variables? I can't think of any off >the top of >>my head. Here's the list of environment variables: >

Re: #! /usr/bin/python{,3} -Es

2012-10-27 Thread Jakub Wilk
* Thomas Kluyver , 2012-10-26, 11:03: Are there any situations where you might want to run a system script with modified Python environment variables? I can't think of any off the top of my head. Here's the list of environment variables: http://docs.python.org/using/cmdline.html#environment-va

Re: #! /usr/bin/python{,3} -Es

2012-10-27 Thread Chow Loong Jin
On 26/10/2012 19:02, Thomas Kluyver wrote: > On 26 October 2012 11:53, Chow Loong Jin wrote: >>> What is the definition of "system" script? >> >> Any script installed via dpkg, perhaps? > > I wouldn't have said so - I install plenty of Python scripts from > packages, like /usr/bin/ipython, that I

Re: #! /usr/bin/python{,3} -Es

2012-10-26 Thread Barry Warsaw
On Oct 26, 2012, at 12:33 PM, Jakub Wilk wrote: >* Thomas Kluyver , 2012-10-26, 11:03: >>Are there any situations where you might want to run a system script >with >>modified Python environment variables? I can't think of any off >the top of >>my head. Here's the list of environment variables: >

Re: #! /usr/bin/python{,3} -Es

2012-10-26 Thread Barry Warsaw
n/python3 -Es' >> >> should do the trick. I don't think adding -Es by default is a good idea >> (although it's very tempting). > >Several people have said they don't think this is a good idea. But >why not? There is a bad effect if you don't rewrit

Re: #! /usr/bin/python{,3} -Es

2012-10-26 Thread Floris Bruynooghe
ere is a bad effect if you don't rewrite the shebang to >> > "/usr/bin/python[3] -ES" that we know of, but is there any example of >> > where such a shebang line would cause trouble that warrants not doing >> > this by default? >> >> Are th

Re: #! /usr/bin/python{,3} -Es

2012-10-26 Thread Thomas Kluyver
On 26 October 2012 14:20, Paul Tagliamonte wrote: > django-admin if I'm using a virtualenv? Perhaps I'm missing the point? > Will this just break all virtualenv support? To my mind, django-admin is not a system script. A system script would be something like the unattended-upgrades script, which

Re: #! /usr/bin/python{,3} -Es

2012-10-26 Thread Paul Tagliamonte
On Fri, Oct 26, 2012 at 11:03:34AM +0100, Thomas Kluyver wrote: > On 26 October 2012 09:19, Floris Bruynooghe wrote: > > Several people have said they don't think this is a good idea. But > > why not? There is a bad effect if you don't rewrite the shebang to > > &

Re: #! /usr/bin/python{,3} -Es

2012-10-26 Thread Thomas Kluyver
On 26 October 2012 11:53, Chow Loong Jin wrote: >> What is the definition of "system" script? > > Any script installed via dpkg, perhaps? I wouldn't have said so - I install plenty of Python scripts from packages, like /usr/bin/ipython, that I wouldn't call system scripts. I don't think there's a

Re: #! /usr/bin/python{,3} -Es

2012-10-26 Thread Chow Loong Jin
On 26/10/2012 18:33, Jakub Wilk wrote: > * Thomas Kluyver , 2012-10-26, 11:03: >> Are there any situations where you might want to run a system script with >> modified Python environment variables? I can't think of any off the top of my >> head. Here's the list of environment variables: >> >> http:

Re: #! /usr/bin/python{,3} -Es

2012-10-26 Thread Jakub Wilk
* Thomas Kluyver , 2012-10-26, 11:03: Are there any situations where you might want to run a system script with modified Python environment variables? I can't think of any off the top of my head. Here's the list of environment variables: http://docs.python.org/using/cmdline.html#environment-va

Re: #! /usr/bin/python{,3} -Es

2012-10-26 Thread Thomas Kluyver
On 26 October 2012 09:19, Floris Bruynooghe wrote: > Several people have said they don't think this is a good idea. But > why not? There is a bad effect if you don't rewrite the shebang to > "/usr/bin/python[3] -ES" that we know of, but is there any example of >

Re: #! /usr/bin/python{,3} -Es

2012-10-26 Thread Floris Bruynooghe
very tempting). Several people have said they don't think this is a good idea. But why not? There is a bad effect if you don't rewrite the shebang to "/usr/bin/python[3] -ES" that we know of, but is there any example of where such a shebang line would cause trouble that

Re: #! /usr/bin/python{,3} -Es

2012-10-25 Thread Piotr Ożarowski
[Steve Langasek, 2012-10-25] > On Thu, Oct 25, 2012 at 10:56:05AM -0400, Barry Warsaw wrote: > > Using -E fixed the immediate bug, but I think it is generally useful to > > include -s also, so as to avoid any potential breakage of system scripts by > > things users may have added locally. > > If t

Re: #! /usr/bin/python{,3} -Es

2012-10-25 Thread Barry Warsaw
On Oct 25, 2012, at 11:18 AM, Steve Langasek wrote: >On Thu, Oct 25, 2012 at 10:56:05AM -0400, Barry Warsaw wrote: >> This doesn't requires a mass freakout, but it might be useful for a mass bug >> filing (of non-urgent priority, I think). I don't have time before UDS-R to >> look into that, so I

Re: #! /usr/bin/python{,3} -Es

2012-10-25 Thread Steve Langasek
On Thu, Oct 25, 2012 at 10:56:05AM -0400, Barry Warsaw wrote: > This doesn't requires a mass freakout, but it might be useful for a mass bug > filing (of non-urgent priority, I think). I don't have time before UDS-R to > look into that, so I at least wanted to send this email to put it on the > ra

Re: #! /usr/bin/python{,3} -Es

2012-10-25 Thread Barry Warsaw
On Oct 25, 2012, at 07:05 PM, Jakub Wilk wrote: >* Barry Warsaw , 2012-10-25, 10:56: >>https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/938869 >> >>When you write system scripts like 'lsb_release' that use >>>/usr/bin/python{,3} in the #! line, please remember to include -Es >>>switches. This pr

Re: #! /usr/bin/python{,3} -Es

2012-10-25 Thread Jakub Wilk
* Barry Warsaw , 2012-10-25, 10:56: https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/938869 When you write system scripts like 'lsb_release' that use /usr/bin/python{,3} in the #! line, please remember to include -Es switches. This prevents the crash in question, where a VMware installer sc

#! /usr/bin/python{,3} -Es

2012-10-25 Thread Barry Warsaw
I wanted to mention something that came up recently in Ubuntu, where lsb_release is a Python 3 script. This isn't specific to Python 3, since Python 2 scripts can also be affected. The Launchpad bug is symptomatic of the more general problem: https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/93