tag | eca56e7b796ba2172ef1c414d74f2dac96a72af6 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Mon Jun 08 14:44:09 2020 -0700 |
object | ad3373a4df7e95eac97683355151e2e427e368ac |
Platform Tools Release 30.0.2 (6538114)
commit | ad3373a4df7e95eac97683355151e2e427e368ac | [log] [tgz] |
---|---|---|
author | android-build-prod (mdb) <android-build-team-robot@google.com> | Mon Mar 30 21:36:08 2020 +0000 |
committer | android-build-prod (mdb) <android-build-team-robot@google.com> | Mon Mar 30 21:36:08 2020 +0000 |
tree | 36e9b12847271cb19979fe56e6eb86c736324068 | |
parent | 73e7c4e935d27d7e841d3c331a8e12a60580a716 [diff] | |
parent | 856d523490c68e3be917383ffecbecb5070bae58 [diff] |
Snap for 6348162 from 856d523490c68e3be917383ffecbecb5070bae58 to sdk-release Change-Id: If000c94cf8aa1f68ce18df85d2c91f04d14915c0
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?