Ned Deily <n...@python.org> added the comment:

ipaddress is behaving as documented:

"The following constitutes a valid IPv4 address:

A string in decimal-dot notation, consisting of four decimal integers in the 
inclusive range 0–255, separated by dots (e.g. 192.168.0.1). Each integer 
represents an octet (byte) in the address. Leading zeroes are tolerated only 
for values less than 8 (as there is no ambiguity between the decimal and octal 
interpretations of such strings). [...]"

https://docs.python.org/3/library/ipaddress.html

I can sort of understand imposing that restriction in a Python 2 world where 
leading zeros implied octal and Python 3 outright rejects such forms of 
integers to avoid the ambiguity.  That said, there's no particular reason why 
the components of an IPv4 string acceptable to ipaddress *have* to follow the 
same rules so I'm +0 on making the change at all.  It's a bit of a stretch to 
consider it a bug when it appears to be behaving as documented but I would 
expect such a change to fix more problems than causing them so I'm OK if you 
want to backport it.

But, in any case, the documentation for 3.8 and/or 3.7 needs to be updated.

----------
keywords: +3.2regression -patch
resolution: fixed -> 
stage: resolved -> needs patch
status: pending -> open

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36384>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to