Summary: | sys-apps/portage-2.2_rc95 TypeError: cannot concatenate 'str' and 'int' objects | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Mikael Magnusson <mikachu> |
Component: | New packages | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aoyu93, fordfrog, jimtahu |
Priority: | High | Keywords: | InVCS, REGRESSION |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 335925 |
Description
Mikael Magnusson
2010-10-14 00:54:02 UTC
(In reply to comment #0) > ips_v4 is [10, '130.230.54.100'] and addrinfos is [(2, 1, 6, '', > ('130.230.54.100', 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 '130.230.54.100. The second address seems odd. It's IPv6 (10 == AF_INET6), with integer address 10. Apparently getaddrinfo() is returning corrupt data. 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]) else: ips_v4.append(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. Ah, I'm an idiot, the actual sockaddr tuple obviously has bogus data in it. I guess it's somewhat reasonable to have corrupt IPv6 addresses when IPv6 support is disabled. Anyway, this should fix it: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c54c1af789b306a85e9d7e79fb54f02a05346616 This is fixed in 2.1.9.18 and 2.2_rc96. *** Bug 340933 has been marked as a duplicate of this bug. *** |