Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 271545 - Portage v2.1.6.11 does not require correct version of python
Summary: Portage v2.1.6.11 does not require correct version of python
Status: VERIFIED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 261959
  Show dependency tree
 
Reported: 2009-05-28 15:24 UTC by Mike Duncan
Modified: 2009-06-29 11:51 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 Mike Duncan 2009-05-28 15:24:43 UTC
Portage v2.1.6.11 does not require Python v2.5 or above. Because portage now uses the IncrementalEncoder (http://www.python.org/doc/2.5.2/lib/incremental-encoder-objects.html) within the codecs module, a version of 2.5 or higher is required for portage to function **at all**.

Reproducible: Always

Steps to Reproduce:
1. equery list | grep python
sys-apps/python-2.4.3-r1
dev-python/pycrypto-2.0.1-r6
dev-python/python-fchksum-1.7.1
2. grep python_dep /usr/portage/sys-apps/portage/portage-2.1.6.11.ebuild
python_dep=">=dev-lang/python-2.4"
DEPEND="${python_dep}
RDEPEND="${python_dep}
3. emerge -v portage
...
4. emerge --info
Traceback (most recent call last):
File "/usr/bin/emerge", line 29, in ?
import _emerge
File "//usr/lib/portage/pym/_emerge/__init__.py", line 26, in ?
import portage
File "//usr/lib/portage/pym/portage/__init__.py", line 8215, in ?
_ensure_default_encoding()
File "//usr/lib/portage/pym/portage/__init__.py", line 7796, in _ensure_default_encoding
encodings = _gen_missing_encodings(missing_encodings)
File "//usr/lib/portage/pym/portage/__init__.py", line 7706, in _gen_missing_encodings
class AsciiIncrementalEncoder(codecs.IncrementalEncoder):
AttributeError: 'module' object has no attribute 'IncrementalEncoder'

Actual Results:  
All portage utilities, including emerge, ebuild, and equery, all produced these results with python-2.4.3-r1 and portage-2.1.6.11 packages installed.

Traceback (most recent call last):
File "/usr/bin/emerge", line 29, in ?
import _emerge
File "//usr/lib/portage/pym/_emerge/__init__.py", line 26, in ?
import portage
File "//usr/lib/portage/pym/portage/__init__.py", line 8215, in ?
_ensure_default_encoding()
File "//usr/lib/portage/pym/portage/__init__.py", line 7796, in _ensure_default_encoding
encodings = _gen_missing_encodings(missing_encodings)
File "//usr/lib/portage/pym/portage/__init__.py", line 7706, in _gen_missing_encodings
class AsciiIncrementalEncoder(codecs.IncrementalEncoder):
AttributeError: 'module' object has no attribute 'IncrementalEncoder'


Expected Results:  
Portage utilities should work normally.

To fix this issue after the install of portage-2.1.6.11, I needed to manually install python some where on the system and use that version to firstly uninstall the python package and then install the newer python v2.5+ package. You need to uninstall python first because of a file conflict with the python-updater binary now in a separate package from python.

See here for more information: http://forums.gentoo.org/viewtopic-t-753449.html.
Comment 1 Zac Medico gentoo-dev 2009-06-03 18:44:21 UTC
Thanks, I've updated the dependency in CVS.
Comment 2 Jakub Zawadzki 2009-06-29 11:27:40 UTC
Hi, Portage 2.2_rc33 works with dev-lang/python-2.4.4-r15
so could python_dep be changed to:

python_dep=">=dev-lang/python-2.4.4-r15" ?

I'll later check what about dev-lang/python-2.4.6

emerge --info below:

Portage 2.2_rc33 (default/linux/amd64/2008.0/desktop, gcc-4.1.2, glibc-2.9_p20081201-r2, 2.6.29.2-dark64 x86_64)
=================================================================
System uname: Linux-2.6.29.2-dark64-x86_64-AMD_Phenom-tm-_9350e_Quad-Core_Processor-with-glibc2.2.5
Timestamp of tree: Mon, 29 Jun 2009 10:30:01 +0000
app-shells/bash:     4.0_p17-r1
dev-lang/python:     2.4.4-r15
dev-python/pycrypto: 2.0.1-r6
dev-util/cmake:      2.4.7-r1
sys-apps/baselayout: 1.12.12
sys-apps/sandbox:    1.9
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O3 -pipe -w"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=athlon64 -O3 -pipe -w"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer nostrip sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="pl_PL.ISO-8859-2"         
LC_ALL="pl_PL.ISO-8859-2"       
LDFLAGS="-Wl,-O1"               
LINGUAS="pl"                    
MAKEOPTS="-j5 -s"               
PKGDIR="/usr/portage/packages"  
PORTAGE_CONFIGROOT="/"          
PORTAGE_RSYNC_EXTRA_OPTS="--progress"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/dev/shm"       
PORTDIR="/usr/portage"          
PORTDIR_OVERLAY="/usr/portage/local/layman/gnash-cvs /usr/portage/local/layman/secondlife /usr/portage/local/layman/oss-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 multilib nls" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl" QEMU_SOFTMMU_TARGETS="i386" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-06-29 11:39:10 UTC
(In reply to comment #2)
> Hi, Portage 2.2_rc33 works with dev-lang/python-2.4.4-r15

No. It doesn't work.

$ grep -r IncrementalEncoder . | grep -v /\.svn/
./pym/portage/__init__.py:              class AsciiIncrementalEncoder(codecs.IncrementalEncoder):
./pym/portage/__init__.py:                      incrementalencoder=AsciiIncrementalEncoder,
./pym/portage/__init__.py:              class Utf8IncrementalEncoder(codecs.IncrementalEncoder):
./pym/portage/__init__.py:                      incrementalencoder=Utf8IncrementalEncoder,
$ python2.4 -c 'import codecs; codecs.IncrementalEncoder'
Traceback (most recent call last):
  File "<string>", line 1, in ?
AttributeError: 'module' object has no attribute 'IncrementalEncoder'
Comment 4 Jakub Zawadzki 2009-06-29 11:51:59 UTC
Right.. Thx for clarification.