Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 448138 - sys-apps/portage no longer works with dev-lang/python-2.5
Summary: sys-apps/portage no longer works with dev-lang/python-2.5
Status: RESOLVED OBSOLETE
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-21 23:15 UTC by Matthew Schultz
Modified: 2016-02-13 03:50 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Schultz 2012-12-21 23:15:47 UTC
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.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-21 23:19:54 UTC
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.
Comment 2 Zac Medico gentoo-dev 2012-12-22 00:04:27 UTC
(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.
Comment 3 Matthew Schultz 2012-12-22 06:52:21 UTC
(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?
Comment 4 Zac Medico gentoo-dev 2012-12-22 07:22:48 UTC
(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.
Comment 5 Kobboi 2013-03-02 09:11:20 UTC
(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.
Comment 6 SpanKY gentoo-dev 2016-02-12 23:05:20 UTC
shall we punt this ?  we don't care about <python-2.7 anymore.
Comment 7 Brian Dolbec gentoo-dev 2016-02-13 03:50:20 UTC
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.