On 2014-06-15 02:40, Robert Xu wrote:
Hi all,
In cooker, we've migrated from python2 to python3; but
updates-alternatives doesn't seem to be on /usr/bin/python and so
basically a ton of python programs are broken now.
Using update-alternatives on something like /usr/bin/python would be a
very bad idea because it would essentially leave you with 2 evils ("I
set python to python3, now application A crashes on startup! I fixed it,
now python is python2, but now I can't run application B!") and because
it would make more subtle problems hard to reproduce ("Application C
crashes when trying to print." - "Works here..." - and in the end it
turns out that whether or not it crashes depends on which python is
being used).
The fix here has to be making sure that python2-only things are either
fixed (often just running 2to3 on them will do the trick) or invoked
with python2 -- usually by editing the first line of the application
("#!/usr/bin/python" -> "#!/usr/bin/python2" or "#!/usr/bin/env python"
-> "#!/usr/bin/env python2").
Yes, this is going to be some work. (I've already done this for a few
things, like abf-console-client).
Nobody said this would be a quick and easy transition.
The mass build will automatically fix a few things by making sure
libraries that are built with whatever /usr/bin/python is will be built
with 3 now. But it won't magically add "python2" commands.
ttyl
bero