Why Ubuntu doesn’t support certain form of shebang for Python?

Neal McBurnett neal at bcn.boulder.co.us
Tue Nov 11 22:52:22 UTC 2014


On Tue, Nov 11, 2014 at 05:19:38PM -0500, Barry Warsaw wrote:
> On Nov 11, 2014, at 11:48 AM, Neal McBurnett wrote:
> 
> >I'm glad that python2 is in Debian and Ubuntu (do you know offhand which
> >releases?).  Which distros is it still not supported in?  Are they likely to
> >catch up?
> 
> Sorry, I don't know off-hand.
> 
> >Do you see a path to a world where compliance with PEP 0394 is the right
> >approach, making the transition to python3 easier?
> >
> >  http://legacy.python.org/dev/peps/pep-0394/
> 
> I suspect PEP 394 will mostly be a reflection of reality rather than a driver
> of downstream policy.  E.g. I think it will be a very long time, if ever,
> that you'll see PEP 394 recommend, or widespread de facto adoption, of
> /usr/bin/python pointing to Python 3.  Maybe by Python 4 <wink>.
> 
> Hopefully though PEP 394 will stop other distros from doing insane things like
> was done with that one existing "adventurous" outlier.
> 
> Cheers,
> -Barry

I should have clarified my point better.  Scott's message recommended putting python, rather than python2 in shebangs, since it works in more distros.  That seems to be In contrast with PEP 394, which says to use python2 rather than python, unless the code works in both python 2.x and python 3.x.  That is in order to facilitate migration, and it would be necessary before anyone could make the next step you talk of (pointing python to python 3).

That's why I'm wondering where the PEP 394 approach doesn't currently work, and when we might indeed recommend following the current PEP 394 standard.

Thanks,

Neal McBurnett                 http://neal.mcburnett.org/




More information about the Ubuntu-devel-discuss mailing list