[issue43769] ipaddress module takes bytes input as valid ip address

2021-04-07 Thread Philip Bond
Philip Bond added the comment: Thanks Eric. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43769] ipaddress module takes bytes input as valid ip address

2021-04-07 Thread Eric V. Smith
Eric V. Smith added the comment: This is documented behavior. See https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address "The following constitutes a valid IPv4 address: ... An integer packed into a bytes object of length 4 (most significant octet first). " And the

[issue43769] ipaddress module takes bytes input as valid ip address

2021-04-07 Thread Eric V. Smith
Eric V. Smith added the comment: The reproducer is: >>> ipaddress.IPv4Address(b"PING") IPv4Address('80.73.78.71') -- components: +Library (Lib) -Unicode nosy: +eric.smith ___ Python tracker

[issue43769] ipaddress module takes bytes input as valid ip address

2021-04-07 Thread Philip Bond
Philip Bond added the comment: To replicate ./cidr-gen.py google.com You will see the IP variable is a Russian IP but that was a red herring, I initially thought its was a compromised module. -- ___ Python tracker

[issue43769] ipaddress module takes bytes input as valid ip address

2021-04-07 Thread Philip Bond
New submission from Philip Bond : Hi I came across an issue with the ipaddress module where it doesent raise a ValueError when passed a non IP address. Example see attached file use tabs for indents and that doesent work with the form. What happens is it when it takes b'PING' as the call