Michał Radwański <lisklusow...@gmail.com> added the comment:

According to the RFC ( https://tools.ietf.org/html/rfc4291#section-2.2 ), last 
four bytes can be an address in the format of IPv4 address. The latter doesn't 
specify whether leading zeros are permitted or not. For illustration let's look 
at the implementation of the POSIX function `inet_aton` from Fedora 28, as 
documented by manual:

> In  all  of the above forms, components of the dotted address can be 
> specified in decimal, octal (with a leading 0), or hexadecimal, with a 
> leading 0X).

But notice that if you prefix a 0 with 0, the value stays the same, so it 
doesn't hurt not to raise errors if given either of 

1111:2222:3333:4444:5555:6666:00.00.00.00
1111:2222:3333:4444:5555:6666:000.000.000.000

If however you try

1111:2222:3333:4444:5555:6666:000.000.010.000

then the address is ambiguous, so appropriately you get 

AddressValueError: Ambiguous (octal/decimal) value in '010' not permitted in 
'000.000.010.000' in '1111:2222:3333:4444:5555:6666:000.000.010.000'


I believe the issue is handled correctly.

----------
nosy: +enedil

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

Reply via email to