Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 340899 - sys-apps/portage-2.2_rc95 TypeError: cannot concatenate 'str' and 'int' objects
Summary: sys-apps/portage-2.2_rc95 TypeError: cannot concatenate 'str' and 'int' objects
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
: 340933 (view as bug list)
Depends on:
Blocks: 335925
  Show dependency tree
Reported: 2010-10-14 00:54 UTC by Mikael Magnusson
Modified: 2010-10-15 21:07 UTC (History)
3 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Magnusson 2010-10-14 00:54:02 UTC
When i run emerge --sync i get this

    Traceback (most recent call last):
      File "/usr/bin/emerge", line 43, in <module>
        retval = emerge_main()
      File "/usr/lib64/portage/pym/_emerge/", line 1604, in emerge_main
        return action_sync(settings, trees, mtimedb, myopts, myaction)
      File "/usr/lib64/portage/pym/_emerge/", line 2130, in action_sync
        "//" + user_name + ip + port + "/", 1))
    TypeError: cannot concatenate 'str' and 'int' objects

ips_v4 is [10, ''] and addrinfos is [(2, 1, 6, '', ('', 0)), (10, 1, 6, '', (10, '\x00\x00\x00\x00\x00\x00 \x01\x07\x08\x03\x10\x00T'))]

Using python 2.6

Portage 2.2_rc95 (default/linux/amd64/10.0/desktop, gcc-4.4.4, glibc-2.11.2-r0, x86_64)
System uname: Linux-
Timestamp of tree: Wed, 13 Oct 2010 22:45:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.5-r1, 1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.3.5, 4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.33 (sys-kernel/linux-headers)
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=core2 -O2 -pipe"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /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"
CXXFLAGS="-march=core2 -O2 -pipe -fpermissive"
EMERGE_DEFAULT_OPTS="--alphabetical --nospinner"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs userfetch"
LINGUAS="sv en ja"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="X a52 aac acpi alsa amd64 avi branding bzip2 cairo canna cdr cli cracklib crypt cups cxx dri dts dvd dvdr emboss encode exif f77 fam firefox flac fortran gdbm gif gpm gs gtk gtk2 gtkhtml iconv idn jpeg jpeg2k kpathsea lcms libnotify lzma mad mikmod mmx mng modules moznocompose moznoirc moznomail mozsvg mp3 mp4 mpeg mudflap multilib ncurses nethack no-old-linux nodrm noutempter nptl nptlonly objc ogg opengl openmp oss pam pango pcre pdf perl pic png ppds pppd python qt3support qt4 readline reflection sdl session sse sse2 ssl startup-notification svg sysfs tetex tiff truetype unicode usb vorbis wmf x264 xattr xml xorg xprint xulrunner xv xvid zlib" 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 asis auth_basic auth_digest authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cgi filter deflate dir env headers include info log_config mime negotiation proxy proxy_http rewrite setenvif status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" 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="evdev keyboard joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="sv en ja" PHP_TARGETS="php-5.2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv" 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" 
Comment 1 Zac Medico gentoo-dev 2010-10-14 01:21:25 UTC
(In reply to comment #0)
> ips_v4 is [10, ''] and addrinfos is [(2, 1, 6, '',
> ('', 0)), (10, 1, 6, '', (10, '\x00\x00\x00\x00\x00\x00
> \x01\x07\x08\x03\x10\x00T'))]

The first address seems fine. It's IPv4 (2 == AF_INET), with string address '

The second address seems odd. It's IPv6 (10 == AF_INET6), with integer address 10. Apparently getaddrinfo() is returning corrupt data.
Comment 2 Mikael Magnusson 2010-10-14 01:32:40 UTC
for addrinfo in addrinfos:
	if socket.has_ipv6 and addrinfo[0] == socket.AF_INET6:
		# IPv6 addresses need to be enclosed in square brackets
		ips_v6.append("[%s]" % addrinfo[4][0])

The problem seems to be in this section, getaddrinfo returned an ipv6 address, but socket.has_ipv6 is false, so the else branch is taken. I'm not sure why it would be corrupt data to return an ipv6 address when it was passed AF_UNSPEC? (I don't know much about network code though).

If I run PORTAGE_RSYNC_EXTRA_OPTS=-4 emerge --sync, no ipv6 address is returned.
Comment 3 Mikael Magnusson 2010-10-14 01:43:10 UTC
Ah, I'm an idiot, the actual sockaddr tuple obviously has bogus data in it.
Comment 4 Zac Medico gentoo-dev 2010-10-14 02:37:51 UTC
I guess it's somewhat reasonable to have corrupt IPv6 addresses when IPv6 support is disabled. Anyway, this should fix it:;a=commit;h=c54c1af789b306a85e9d7e79fb54f02a05346616
Comment 5 Zac Medico gentoo-dev 2010-10-14 04:54:10 UTC
This is fixed in and 2.2_rc96.
Comment 6 Sebastian Luther (few) 2010-10-14 07:10:05 UTC
*** Bug 340933 has been marked as a duplicate of this bug. ***