Message271237
This also affects socket.getaddrinfo on macOS only, but is fine on Linux. I've not tested on Windows to see behavior there.
Given the IP address `0177.0000.0000.0001`, which is a valid octal format representing `127.0.0.1`, we can see varying results. Confirmed in both python 2.7 and 3.5.
First, socket.gethostbyname is always wrong, and always returns `177.0.0.1`:
```
>>> socket.gethostbyname('0177.0000.0000.0001')
'177.0.0.1'
```
This can be seen on both Linux and macOS.
With `socket.getaddrinfo`, resolution is correct on Linux, but the bad 177.0.0.1 on macOS.
Linux:
```
>>> socket.getaddrinfo('0177.0000.0000.0001', None)[0]
(2, 1, 6, '', ('127.0.0.1', 0))
```
macOS:
```
>>> socket.getaddrinfo('0177.0000.0000.0001', None)[0]
(2, 2, 17, '', ('177.0.0.1', 0))
```
This behavior exists in both 2.7.12 and 3.5.2 at least. I haven't tested many others, but I assume pretty universal. |
|
Date |
User |
Action |
Args |
2016-07-25 06:27:54 | mattrobenolt | set | recipients:
+ mattrobenolt |
2016-07-25 06:27:54 | mattrobenolt | set | messageid: <1469428074.1.0.701366093272.issue27612@psf.upfronthosting.co.za> |
2016-07-25 06:27:54 | mattrobenolt | link | issue27612 messages |
2016-07-25 06:27:53 | mattrobenolt | create | |
|