Message230686
Python 3.3/3.4 sometimes does not recognize a legitimate IPv6Network netmask:
$ python3
Python 3.3.5 (default, May 28 2014, 13:56:57)
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipaddress as ip
>>> nodecon = ip.IPv6Network('ff00::/ff00::')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.3/ipaddress.py", line 2084, in __init__
self._prefixlen = self._prefix_from_prefix_string(addr[1])
File "/usr/lib64/python3.3/ipaddress.py", line 514, in _prefix_from_prefix_string
self._report_invalid_netmask(prefixlen_str)
File "/usr/lib64/python3.3/ipaddress.py", line 497, in _report_invalid_netmask
raise NetmaskValueError(msg) from None
ipaddress.NetmaskValueError: 'ff00::' is not a valid netmask
>>> nodecon = ip.IPv6Network('ff00::/8')
>>> print(nodecon)
ff00::/8
>>> print(nodecon.with_netmask)
ff00::/ff00::
I get the same behavior on Python 3.4.2. |
|
Date |
User |
Action |
Args |
2014-11-05 15:34:45 | pebenito | set | recipients:
+ pebenito |
2014-11-05 15:34:45 | pebenito | set | messageid: <1415201685.68.0.536631906861.issue22800@psf.upfronthosting.co.za> |
2014-11-05 15:34:45 | pebenito | link | issue22800 messages |
2014-11-05 15:34:45 | pebenito | create | |
|