This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author anudeepballa07
Recipients anudeepballa07
Date 2020-09-20.06:46:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600584397.02.0.984052429754.issue41820@roundup.psfhosted.org>
In-reply-to
Content
https://docs.python.org/3.8/library/ipaddress.html

import ipaddress


ADDRESSES = [
    '172.16.254.00'
]

for ip in ADDRESSES:
    addr = ipaddress.ip_address(ip)
    if addr.version==4:
        {
            print("true")
        }
    else:
        {
            print("false")
        }
Screen Shot 2020-09-20 at 1 33 30 AM

I tried to validate an invalid IPv4 address using IPaddress library from py 3.8.6 but somehow it considers any address ending with "00" to be valid.

I hope this is helpful to the community please let me know if the issue is with validation from your end or a bug in the library.

@AnudeepBalla
History
Date User Action Args
2020-09-20 06:46:37anudeepballa07setrecipients: + anudeepballa07
2020-09-20 06:46:37anudeepballa07setmessageid: <1600584397.02.0.984052429754.issue41820@roundup.psfhosted.org>
2020-09-20 06:46:36anudeepballa07linkissue41820 messages
2020-09-20 06:46:36anudeepballa07create