python 2.5 no longer works with the oldest version of portage in the tree: 2.1.6.7_p1. If it's not going to be removed from the portage tree, then the portage programs should be modified to check which version of python they are attempting to run and gracefully error with a message that lets the user know what is the minimum version of python they must be using to run the program. Reproducible: Always Steps to Reproduce: 1. eselect python 2.5 or use EPYTHON variable before command 2. run emerge some-package or ebuild some.ebuild Actual Results: EPYTHON=python2.5 emerge some-package /usr/bin/emerge:49: Warning: 'as' will become a reserved keyword in Python 2.6 File "/usr/bin/emerge", line 49 except PermissionDenied as e: ^ SyntaxError: invalid syntax EPYTHON=python2.5 ebuild some.ebuild digest /usr/bin/ebuild:173: Warning: 'with' will become a reserved keyword in Python 2.6 File "/usr/bin/ebuild", line 173 with io.open(_unicode_encode(ebuild, encoding=_encodings['fs'], errors='strict'), ^ SyntaxError: invalid syntax Expected Results: You must select python 2.6 or higher to run this program.
To be honest, I was thinking of converting portage to python-r1 and making it gracefully handle things through python-exec. But that's something that'd require making it EAPI=5.
(In reply to comment #0) > python 2.5 no longer works with the oldest version of portage in the tree: > 2.1.6.7_p1. I think your statement is wrong, because 2.1.6.7_p1 is supposed to support python 2.4 and 2.5. > Steps to Reproduce: > 1. eselect python 2.5 or use EPYTHON variable before command > 2. run emerge some-package or ebuild some.ebuild > Actual Results: > EPYTHON=python2.5 emerge some-package > /usr/bin/emerge:49: Warning: 'as' will become a reserved keyword in Python > 2.6 > File "/usr/bin/emerge", line 49 > except PermissionDenied as e: > ^ > SyntaxError: invalid syntax This looks like a later version of portage than 2.1.6.7_p1. All code in 2.1.6.7_p1 is supposed to have valid syntax for python 2.4 and 2.5. > Expected Results: > You must select python 2.6 or higher to run this program. I guess maybe we can use python-exec to handle this, as suggested in comment #1, but I'm not familiar with python-exec.
(In reply to comment #2) > (In reply to comment #0) > > python 2.5 no longer works with the oldest version of portage in the tree: > > 2.1.6.7_p1. > > I think your statement is wrong, because 2.1.6.7_p1 is supposed to support > python 2.4 and 2.5. > I stand corrected. For some reason I thought I saw it depending on >= 2.6. Regardless, shouldn't there be some kind of version check in the portage programs to check the version of python they're trying to run and if that version isn't supported, it should error with a message why instead of just a syntax error?
(In reply to comment #3) > Regardless, shouldn't there be some kind of version check in the portage > programs to check the version of python they're trying to run and if that > version isn't supported, it should error with a message why instead of just > a syntax error? I guess that would be nice, though it's not typical for python applications to do this sort of thing. Also, it seems like this sort of error handling would not benefit many people, so it would be hard to justify any extra complexity that it might introduce.
(In reply to comment #4) > (In reply to comment #3) > > Regardless, shouldn't there be some kind of version check in the portage > > programs to check the version of python they're trying to run and if that > > version isn't supported, it should error with a message why instead of just > > a syntax error? > > I guess that would be nice, though it's not typical for python applications > to do this sort of thing. Also, it seems like this sort of error handling > would not benefit many people, so it would be hard to justify any extra > complexity that it might introduce. Well, I just ran into: $ sudo emerge --sync && sudo emerge -u gnome -av >>> Starting rsync with rsync://140.211.166.189/gentoo-portage... >>> Checking server timestamp ... Traceback (most recent call last): File "/usr/bin/emerge", line 51, in <module> retval = emerge_main() File "/usr/lib/portage/pym/_emerge/main.py", line 1044, in emerge_main gc_locals=locals().clear) File "/usr/lib/portage/pym/_emerge/actions.py", line 3806, in run_action return action_sync(settings, trees, mtimedb, myopts, myaction) File "/usr/lib/portage/pym/_emerge/actions.py", line 2394, in action_sync mycommand, returnpid=True, **spawn_kwargs)) TypeError: spawn() keywords must be strings christophe@boll ~ $ eselect python list Available Python interpreters: [1] python2.6 * [2] python2.7 [3] python3.1 [4] python3.2 Setting it to 2.7 fixes the issue. I saw portage ebuilds with elog messages about 2.6, but not about 2.7. If valid, could you update the warning in the ebuild? I agree it does not have to be in the code itself.
shall we punt this ? we don't care about <python-2.7 anymore.
Yup, 2.2.8-r2 is the oldest still in the tree. And it is only there for py-2.6 compatibility to help upgrade an older system. Even that is pushing the limits of a gentoo system upgrade.