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 mattrobenolt
Recipients koobs, mattrobenolt, ned.deily, r.david.murray, ronaldoussoren, xiang.zhang
Date 2016-07-25.15:22:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469460157.74.0.151827114957.issue27612@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry, to add a data point, in C, `gethostbyname` also does the correct thing on macOS.

See:

```
#include <stdio.h>
#include <errno.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

int main(int argc, char *argv[]) {
    int i;
    struct hostent *lh = gethostbyname("0177.0000.0000.0001");
    struct in_addr **addr_list;

    if (lh) {
        addr_list = (struct in_addr **)lh->h_addr_list;
        for (i=0; addr_list[i] != NULL; i++) {
            printf("%s", inet_ntoa(*addr_list[i]));
        }
        printf("\n");
    } else {
        herror("gethostbyname");
    }

    return 0;
}
```

So I'm not sure this is platform specific.

Either way, `socket.gethostbyname` is wrong on both linux and macOS. I'm a bit lost with what's going on here though, admittedly. :)
History
Date User Action Args
2016-07-25 15:22:37mattrobenoltsetrecipients: + mattrobenolt, ronaldoussoren, ned.deily, r.david.murray, koobs, xiang.zhang
2016-07-25 15:22:37mattrobenoltsetmessageid: <1469460157.74.0.151827114957.issue27612@psf.upfronthosting.co.za>
2016-07-25 15:22:37mattrobenoltlinkissue27612 messages
2016-07-25 15:22:37mattrobenoltcreate