[issue27694] Socket incorrectly states IP address that start with a zero after a dot are illegal

Martin Panter report at bugs.python.org
Fri Aug 5 11:06:36 EDT 2016


Martin Panter added the comment:

I am pretty sure it isn’t legal. Python’s inet_aton() just wraps the underlying OS call. According to Posix <http://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_addr.html>, the leading zero in 093 would indicate octal notation, but the nine is not a valid octal digit.

>>> inet_ntoa(inet_aton("192.168.10.1"))
'192.168.10.1'
>>> inet_ntoa(inet_aton("192.168.010.1"))
'192.168.8.1'

----------
nosy: +martin.panter
resolution:  -> not a bug
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27694>
_______________________________________


More information about the Python-bugs-list mailing list