← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2055173] [NEW] [netaddr>=1.0.0] Do not use netaddr.core.ZEROFILL flag with IPv6 addresses

 

Public bug reported:

In case of using this flag, that will raise the following exception:
>>> netaddr.IPAddress("200a::1", flags=netaddr.core.ZEROFILL)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/netaddr/ip/__init__.py", line 333, in __init__
    self._value = module.str_to_int(addr, flags)
  File "/usr/local/lib/python3.10/dist-packages/netaddr/strategy/ipv4.py", line 120, in str_to_int
    addr = '.'.join(['%d' % int(i) for i in addr.split('.')])
  File "/usr/local/lib/python3.10/dist-packages/netaddr/strategy/ipv4.py", line 120, in <listcomp>
    addr = '.'.join(['%d' % int(i) for i in addr.split('.')])
ValueError: invalid literal for int() with base 10: '200a::1'

** Affects: neutron
     Importance: Medium
     Assignee: Rodolfo Alonso (rodolfo-alonso-hernandez)
         Status: In Progress

** Changed in: neutron
   Importance: Undecided => Medium

** Changed in: neutron
     Assignee: (unassigned) => Rodolfo Alonso (rodolfo-alonso-hernandez)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2055173

Title:
  [netaddr>=1.0.0] Do not use netaddr.core.ZEROFILL flag with IPv6
  addresses

Status in neutron:
  In Progress

Bug description:
  In case of using this flag, that will raise the following exception:
  >>> netaddr.IPAddress("200a::1", flags=netaddr.core.ZEROFILL)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python3.10/dist-packages/netaddr/ip/__init__.py", line 333, in __init__
      self._value = module.str_to_int(addr, flags)
    File "/usr/local/lib/python3.10/dist-packages/netaddr/strategy/ipv4.py", line 120, in str_to_int
      addr = '.'.join(['%d' % int(i) for i in addr.split('.')])
    File "/usr/local/lib/python3.10/dist-packages/netaddr/strategy/ipv4.py", line 120, in <listcomp>
      addr = '.'.join(['%d' % int(i) for i in addr.split('.')])
  ValueError: invalid literal for int() with base 10: '200a::1'

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2055173/+subscriptions



Follow ups