[issue35989] ipaddress.IPv4Network allows prefix > 32

John Florian report at bugs.python.org
Wed Feb 13 11:13:55 EST 2019


New submission from John Florian <jflorian.doubledog at gmail.com>:

I wanted a simple is_valid_ipv4_network() function, so I wrote one and a bunch of unit tests where I discovered that I can legally:

>>> n = IPv4Network(('192.168.123.234', 12345678))
>>> n
IPv4Network('192.168.123.234/12345678')
>>> n.prefixlen
12345678
>>> n.max_prefixlen
32

I assume this is a bug.

----------
messages: 335460
nosy: John Florian
priority: normal
severity: normal
status: open
title: ipaddress.IPv4Network allows prefix > 32
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35989>
_______________________________________


More information about the Python-bugs-list mailing list