[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 to 
ipaddress.IPv4Address(address) as the byte value == 4 it doesent raise a 
ValueError as the bytes for PING are 50 49 4e 47

--
components: Unicode
files: cidr-gen.py
messages: 390478
nosy: ezio.melotti, philip.bond, vstinner
priority: normal
severity: normal
status: open
title: ipaddress module takes bytes input as valid ip address
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file49940/cidr-gen.py

___
Python tracker 
<https://bugs.python.org/issue43769>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
<https://bugs.python.org/issue43769>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
<https://bugs.python.org/issue43769>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com