Comment 1 for bug 1930222

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Python3.9 "ipaddress.ip_interface" does not support leading zeroes:
>>> ipaddress.ip_interface('00.0.0.0/0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.9/ipaddress.py", line 118, in ip_interface
    raise ValueError('%r does not appear to be an IPv4 or IPv6 interface' %
ValueError: '00.0.0.0/0' does not appear to be an IPv4 or IPv6 interface

The class called from "ipaddress.ip_interface":
>>> ipaddress.IPv4Interface('00.0.0.0/0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.9/ipaddress.py", line 1390, in __init__
    IPv4Address.__init__(self, addr)
  File "/usr/lib/python3.9/ipaddress.py", line 1307, in __init__
    self._ip = self._ip_int_from_string(addr_str)
  File "/usr/lib/python3.9/ipaddress.py", line 1199, in _ip_int_from_string
    raise AddressValueError("%s in %r" % (exc, ip_str)) from None
ipaddress.AddressValueError: Leading zeros are not permitted in '00' in '00.0.0.0'