


doesn't eselect use python?gami wrote:Python 3.1 is indeed installed in a new slot (like every previous new python minor version). And it is not made the default python on your machine unless you choose to do so yourself with eselect-python. So simply installing Python 3.1 should be safe. If you make it the active version you may encounter problems. Feel free to report those.
Yes, this is indeed a problem... Not thinking I went ahead and did a depclean and removed python-2.6. I ran eselect to switch to python-3.1 but everything portage related is broken. Anyone have any suggestions on how I can get 3.1 working properly with all the portage utils?LukynZ wrote:well yes, it is new slot, but depclean unmerge old one and then is a problem 'cause emerge is in python...
Code: Select all
File "/usr/bin/emerge", line 41
except PermissionDenied, e:
^
SyntaxError: invalid syntaxCode: Select all
File "/usr/bin/portageq", line 52
print "ERROR: insufficient parameters!"
^
SyntaxError: invalid syntax
* Unable to proceed. Can not find PORTDIR. Make sure the command:
*
* portageq portdir
* returns a value. If it doesn't, make sure you have updated to
* latest portage version.
*
* Report bugs to http://bugs.gentoo.org/eselect is written in bash.poly_poly-man wrote:doesn't eselect use python?gami wrote:Python 3.1 is indeed installed in a new slot (like every previous new python minor version). And it is not made the default python on your machine unless you choose to do so yourself with eselect-python. So simply installing Python 3.1 should be safe. If you make it the active version you may encounter problems. Feel free to report those.

The problem is that Python 3.x changed the 2.x language syntax. So emerge has to be rewritten to support 3.x.blm wrote: I tried editing emerge and portageq to use /usr/bin/python3.1 instead of the /usr/bin/python wrapper to no avail -- results are the same.
Code: Select all
Old: print "The answer is", 2*2
New: print("The answer is", 2*2)
The following works in Python 2.6:Kingoftherings wrote:The problem is that Python 3.x changed the 2.x language syntax. So emerge has to be rewritten to support 3.x.
This is the biggest syntax change:Code: Select all
Old: print "The answer is", 2*2 New: print("The answer is", 2*2)
Code: Select all
from __future__ import print_function
print("The answer is", 2*2)

The following works in both Python 3.* and all versions of Python 2.*:mtjm wrote:The following works in Python 2.6:Kingoftherings wrote:The problem is that Python 3.x changed the 2.x language syntax. So emerge has to be rewritten to support 3.x.
This is the biggest syntax change:Code: Select all
Old: print "The answer is", 2*2 New: print("The answer is", 2*2)Code: Select all
from __future__ import print_function print("The answer is", 2*2)
Code: Select all
print("The answer is %s" % (2*2))
Yeah you're right, but the point being that there are changes that don't work in 2.6.mtjm wrote:The following works in Python 2.6:Kingoftherings wrote:The problem is that Python 3.x changed the 2.x language syntax. So emerge has to be rewritten to support 3.x.
This is the biggest syntax change:Code: Select all
Old: print "The answer is", 2*2 New: print("The answer is", 2*2)For every program it is possible to make it work with both Python 2.6 and Python 3.0.Code: Select all
from __future__ import print_function print("The answer is", 2*2)
print is the biggest breakage since it is a keyword -> function change but it isn't the worst (that can easily be fixed via a sed)Kingoftherings wrote:The problem is that Python 3.x changed the 2.x language syntax. So emerge has to be rewritten to support 3.x.blm wrote: I tried editing emerge and portageq to use /usr/bin/python3.1 instead of the /usr/bin/python wrapper to no avail -- results are the same.
This is the biggest syntax change:Code: Select all
Old: print "The answer is", 2*2 New: print("The answer is", 2*2)
2.4, 2.5 and 2.6 all required porting of some programs. The Plone CMS still uses Python 2.4. For Python 3 just some more changes are done, some of them are removal of features having better alternatives since 2.4 or earlier.Naib wrote:tbf py2.x -> py3 isn't as bad as the noise is making out. It isn't the 1st time python have broken backwards compatibility, I was bitten py2.3 -> py2.4 when they removed means to access the list being constructed within the list-comprehension, its just this time round there are some bigger syntax changes
Thanks, I forgot python-updater updates to the 'currently selected' version, not the 'latest' version. (And don't worry, I won't make 3.1 the current one just yet!)Naib wrote:make sure : eselect python list is set to py2.6 (python are going for a python wrapper script for multABI compat mode via EPYTHON variable)
python-updater would only work if you changed the eselect python setting tho
Code: Select all
# cd /usr/portage/profiles/package.mask
# grep -B 2 python ./*
./funtoo-cautionary-# Daniel Robbins <drobbins@funtoo.org> (02 Aug 2009)
./funtoo-cautionary-# let's watch upstream bugs for a bit:
./funtoo-cautionary:>=dev-lang/python-3
