Message323906
Hi,
the ipaddress module accepts `bytes' objects in the constructors.
`bytearray' however is not supported, see paste below.
Should this be supported too?
>>> import ipaddress
>>> ipaddress.IPv4Address(bytes([127, 0, 0, 1]))
IPv4Address('127.0.0.1')
>>> ipaddress.IPv4Address(bytearray([127, 0, 0, 1]))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.7/ipaddress.py", line 1301, in __init__
self._ip = self._ip_int_from_string(addr_str)
File "/usr/lib/python3.7/ipaddress.py", line 1135, in _ip_int_from_string
raise AddressValueError("Expected 4 octets in %r" % ip_str)
ipaddress.AddressValueError: Expected 4 octets in "bytearray(b'\\x7f\\x00\\x00\\x01')" |
|
Date |
User |
Action |
Args |
2018-08-22 19:48:00 | joernheissler | set | recipients:
+ joernheissler |
2018-08-22 19:48:00 | joernheissler | set | messageid: <1534967280.44.0.56676864532.issue34465@psf.upfronthosting.co.za> |
2018-08-22 19:48:00 | joernheissler | link | issue34465 messages |
2018-08-22 19:48:00 | joernheissler | create | |
|