Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 379469 - sys-apps/portage-2.2.01.19011: Error installing binary packages with emerge due encoding
Summary: sys-apps/portage-2.2.01.19011: Error installing binary packages with emerge d...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Solaris
: Normal normal (vote)
Assignee: Gentoo Prefix
URL: http://git.overlays.gentoo.org/gitweb...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-16 20:33 UTC by Hector Rivas
Modified: 2011-08-25 20:34 UTC (History)
0 users

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 Hector Rivas 2011-08-16 20:33:59 UTC
Installing precompiled package in gentoo prefix for solaris10, it fails with "ValueError: binary mode doesn't take an encoding argument" because a file is open in unicode mode using the io module in the usr/lib/portage/pym/_emerge/Binpkg.py.


Reproducible: Always

Steps to Reproduce:
1. Install emerge on solaris prefix
2. Compile a package 
3. Try to install the package
Actual Results:  
$ emerge --usepkg =binutils-2.19.1-r01.1
Calculating dependencies... done!

>>> Emerging binary (1 of 1) sys-devel/binutils-2.19.1-r01.1
 * binutils-2.19.1-r01.1.tbz2 MD5 SHA1 size ;-) ...                      [ ok ]
>>> Extracting info
Traceback (most recent call last):
  File "/eprefix//SunOS-sparc/gentoo/usr/bin/emerge", line 44, in <module>
    retval = emerge_main()
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/main.py", line 1913, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/actions.py", line 437, in action_build
    retval = mergetask.merge()
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/Scheduler.py", line 1066, in merge
    rval = self._merge()
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/Scheduler.py", line 1416, in _merge
    self._main_loop()
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/Scheduler.py", line 1566, in _main_loop
    self._poll_loop()
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/PollScheduler.py", line 193, in _poll_loop
    handler(f, event)
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/SpawnProcess.py", line 234, in _dummy_handler
    self._unregister_if_appropriate(event)
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/AbstractPollTask.py", line 61, in _unregister_if_appropriate
    self.wait()
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 46, in wait
    self._wait_hook()
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 128, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/EbuildPhase.py", line 238, in _ebuild_exit
    self.wait()
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 46, in wait
    self._wait_hook()
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 128, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/eprefix//SunOS-sparc/gentoo/usr/lib/portage/pym/_emerge/Binpkg.py", line 281, in _clean_exit
    mode='wb', encoding=_encodings['content'], errors='strict')
ValueError: binary mode doesn't take an encoding argument

Expected Results:  
Package installed as expected

Packages info:

[code]
$ emerge --info python emerge
Portage 2.2.01.19011-prefix (prefix/sunos/solaris/5.10/sparc, gcc-4.2.4, unavailable, 5.10 sun4u)
=================================================================
                        System Settings
=================================================================
System uname: Solaris-2.10-sun4u-sparc-32bit-ELF
Timestamp of tree: Wed, 10 Aug 2011 15:38:46 +0000
app-shells/bash:      4.2_p10
dev-lang/python:      2.7.2
dev-util/pkgconfig:   0.25-r2
sys-devel/autoconf:   2.68
sys-devel/automake:   1.11.1
sys-devel/binutils:   2.19.1-r01.1
sys-devel/gcc:        4.2.4-r01.3
sys-devel/gcc-config: 1.4.1-r00.2
sys-devel/libtool:    2.4-r01.1
sys-devel/make:       3.82
Repositories: gentoo_prefix
Installed sets:
ACCEPT_KEYWORDS="~sparc-solaris"
ACCEPT_LICENSE="* -@EULA"
CBUILD="sparc-sun-solaris2.10"
CFLAGS=""
CHOST="sparc-sun-solaris2.10"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/portage /etc/terminfo"
CXXFLAGS=""
DISTDIR="/eprefix//SunOS-sparc/gentoo/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles fixpackages news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C"
LDFLAGS=""
PKGDIR="/eprefix//SunOS-sparc/gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/eprefix//SunOS-sparc/gentoo/"
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="/tmp"
PORTDIR="/eprefix//SunOS-sparc/gentoo/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="cracklib cxx modules ncurses prefix readline sparc-solaris ssl zlib" 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 cgi cgid 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" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="SunOS" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="SunOS" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-lang/python-2.7.2 was built with the following:
USE="bootstrap ncurses (prefix) readline threads (wide-unicode) xml (-aqua) (-berkdb) -build -doc -examples -gdbm -ipv6 -sqlite -ssl -tk -wininst"
CFLAGS="-fwrapv -I/eprefix//SunOS-sparc/gentoo/usr/include -L/eprefix//SunOS-sparc/gentoo/lib -L/eprefix//SunOS-sparc/gentoo/usr/lib"
CXXFLAGS="-fwrapv -I/eprefix//SunOS-sparc/gentoo/usr/include -L/eprefix//SunOS-sparc/gentoo/lib -L/eprefix//SunOS-sparc/gentoo/usr/lib"
LDFLAGS="-L/eprefix//SunOS-sparc/gentoo/usr/lib -R/eprefix//SunOS-sparc/gentoo/usr/lib -L/eprefix//SunOS-sparc/gentoo/lib -R/eprefix//SunOS-sparc/gentoo/lib -L/eprefix//SunOS-sparc/gentoo/tmp/usr/lib -R/eprefix//SunOS-sparc/gentoo/tmp/usr/lib -L."
[/code]

[code]
Portage 2.2.01.19011-prefix (prefix/sunos/solaris/5.10/sparc, gcc-4.2.4, unavailable, 5.10 sun4u)
=================================================================
                        System Settings
=================================================================
System uname: Solaris-2.10-sun4u-sparc-32bit-ELF
Timestamp of tree: Wed, 10 Aug 2011 15:38:46 +0000
app-shells/bash:      4.2_p10
dev-lang/python:      2.7.2
dev-util/pkgconfig:   0.25-r2
sys-devel/autoconf:   2.68
sys-devel/automake:   1.11.1
sys-devel/binutils:   2.19.1-r01.1
sys-devel/gcc:        4.2.4-r01.3
sys-devel/gcc-config: 1.4.1-r00.2
sys-devel/libtool:    2.4-r01.1
sys-devel/make:       3.82
Repositories: gentoo_prefix
Installed sets:
ACCEPT_KEYWORDS="~sparc-solaris"
ACCEPT_LICENSE="* -@EULA"
CBUILD="sparc-sun-solaris2.10"
CFLAGS=""
CHOST="sparc-sun-solaris2.10"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/portage /etc/terminfo"
CXXFLAGS=""
DISTDIR="/apps/murex/local/SunOS-sparc/gentoo/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles fixpackages news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C"
LDFLAGS=""
PKGDIR="/apps/murex/local/SunOS-sparc/gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/apps/murex/local/SunOS-sparc/gentoo/"
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="/tmp"
PORTDIR="/apps/murex/local/SunOS-sparc/gentoo/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="cracklib cxx modules ncurses prefix readline sparc-solaris ssl zlib" 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 cgi cgid 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" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="SunOS" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="SunOS" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sys-apps/portage-2.2.01.19011 was built with the following:
USE="less (prefix) -build -doc -epydoc (-ipc) -prefix-chaining (-selinux)" LINGUAS="-pl"
[/code]



Proposed solution, change the file $EPREFIX/usr/lib/portage/pym/_emerge/Binpkg.py

[code]
$ diff -Nur "usr/lib/portage/pym/_emerge/Binpkg.py~" "usr/lib/portage/pym/_emerge/Binpkg.py"            
--- usr/lib/portage/pym/_emerge/Binpkg.py~      2011-08-16 16:14:46.000000000 -0400
+++ usr/lib/portage/pym/_emerge/Binpkg.py       2011-08-16 16:17:24.120560000 -0400
@@ -280,7 +280,7 @@
                        encoding=_encodings['fs'], errors='strict'),
                        mode='w', encoding=_encodings['content'], errors='strict')
                try:
-                       f.write(EPREFIX + "\n")
+                       f.write(_unicode_decode(EPREFIX + "\n"))
                finally:
                        f.close()

[/code]
Comment 1 Fabian Groffen gentoo-dev 2011-08-25 20:27:42 UTC
committed, thanks
Comment 2 Fabian Groffen gentoo-dev 2011-08-25 20:34:26 UTC
available in 2.2.01.19074