Bug: 132083173

Clone this repo:
  1. e3f35f5 [LSC] Add LOCAL_LICENSE_KINDS to external/python/ipaddress am: d76ed6c2b9 am: 374f8f6a52 am: 92ed9de7aa by Bob Badour · 11 months ago android-s-v2-preview-1 android12--mainline-release android12-dev android12-qpr1-d-release android12-qpr1-d-s1-release android12-qpr1-d-s2-release android12-qpr1-d-s3-release android12-qpr1-release master android-12.0.0_r16 android-12.0.0_r18 android-12.0.0_r19 android-12.0.0_r20 android-12.0.0_r21 android-12.0.0_r26 android-12.0.0_r27 android-mainline-12.0.0_r4 android-s-v2-beta-2 android-s-v2-preview-2
  2. 92ed9de [LSC] Add LOCAL_LICENSE_KINDS to external/python/ipaddress am: d76ed6c2b9 am: 374f8f6a52 by Bob Badour · 11 months ago
  3. 374f8f6 [LSC] Add LOCAL_LICENSE_KINDS to external/python/ipaddress am: d76ed6c2b9 by Bob Badour · 11 months ago android-s-beta-4 android-s-beta-5 android-s-beta-1 android-s-beta-2 android-s-beta-3
  4. d76ed6c [LSC] Add LOCAL_LICENSE_KINDS to external/python/ipaddress by Bob Badour · 12 months ago
  5. 016488d Remove test mapping file for acloud_test am: 613100f4af am: fbe78d8d00 am: 2a6656e291 by Julien Desprez · 1 year ago

ipaddress

Python 3.3+'s ipaddress for Python 2.6, 2.7, 3.2.

This repository tracks the latest version from cpython, e.g. ipaddress from cpython 3.8 as of writing.

Note that just like in Python 3.3+ you must use character strings and not byte strings for textual IP address representations:

>>> from __future__ import unicode_literals
>>> ipaddress.ip_address('1.2.3.4')
IPv4Address(u'1.2.3.4')

or

>>> ipaddress.ip_address(u'1.2.3.4')
IPv4Address(u'1.2.3.4')

but not:

>>> ipaddress.ip_address(b'1.2.3.4')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ipaddress.py", line 163, in ip_address
    ' a unicode object?' % address)
ipaddress.AddressValueError: '1.2.3.4' does not appear to be an IPv4 or IPv6 address. Did you pass in a bytes (str in Python 2) instead of a unicode object?