[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#785275: ITP: python-ipaddress -- Backport of the ipaddress module from Python 3.3



On Mon, 8 Jun 2015 at 15:27 Tristan Seligmann <mithrandi@mithrandi.net> wrote:
>>> import ipaddr, ipaddress
>>> ipaddress.ip_address(b'\x7f\x00\x00\x01')
IPv4Address(u'127.0.0.1')
>>> ipaddr.IPAddress(b'\x7f\x00\x00\x01')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mithrandi/deployment/virtualenvs/tempenv-56cd218832e2d/local/lib/python2.7/site-packages/ipaddr.py", line 78, in IPAddress
    address)
ValueError: '\x7f\x00\x00\x01' does not appear to be an IPv4 or IPv6 address

For a more obnoxious example:

>>> import ipaddress, ipaddr
>>> ipaddress.ip_address(b'0::1')
IPv4Address(u'48.58.58.49')
>>> ipaddr.IPAddress(b'0::1')
IPv6Address('::1')

Reply to: