This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lepaperwan
Recipients Michael.Felt, asvetlov, eamanu, lepaperwan, maxifree, miss-islington, twisteroid ambassador, yselivanov
Date 2019-05-30.08:27:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Assuming similar configuration to the one in msg343430, a simple native getaddrinfo test to check whether any scope ID is returned.

#include <arpa/inet.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>

void test(char *addrstr) {
    int status;
    struct addrinfo *res;
    struct addrinfo *iter;
    struct sockaddr_in6 *addr;

    status = getaddrinfo(addrstr, "80", NULL, &res);
    if (status != 0) {
        fprintf(stderr, "getaddrinfo(%s) returned %i\n", addrstr, status);


    for (iter = res; iter; iter = iter->ai_next) {
        if (iter->ai_addr->sa_family != AF_INET6)

        addr = (struct sockaddr_in6 *) iter->ai_addr;
        if (addr->sin6_scope_id != 0) {
            fprintf(stdout, "getaddrinfo(%s) return scope %u\n", addrstr, addr->sin6_scope_id);


int main() {

    return 0;

I've explicitly tested against numeric and named interfaces to ensure that this isn't linked to AIX only handling named interfaces for scopes instead of numeric ones (although given your `netstat` output, that's be surprising).

Since I've had to look for AIX programming documentation just to be sure, I also stumbled upon this AIX bug (which is referenced by the one I mentioned previously but I missed that). It seem to apply up to 7100-03 so you should be immune nonetheless.

I also noticed that it mentions SSH not working so I went and checked the OpenSSH sources to see how they handle AIX.
While they have an explicit BROKEN_GETADDRINFO define, it doesn't check for the specific scoped IPv6 address issue so I'm not sure they decided to special case it.

If this is truly an "idiosyncrasy" in AIX, I'm not sure there is a better way to handle it than skipping it since it's not really a Python bug if the underlying `libc` doesn't work as intended.
Date User Action Args
2019-05-30 08:27:25lepaperwansetrecipients: + lepaperwan, asvetlov, yselivanov, Michael.Felt, eamanu, twisteroid ambassador, miss-islington, maxifree
2019-05-30 08:27:25lepaperwansetmessageid: <>
2019-05-30 08:27:25lepaperwanlinkissue35545 messages
2019-05-30 08:27:24lepaperwancreate