phihag / ipaddress

Python 3.3+'s ipaddress for older Python versions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

127.0.0.1 is not considered as private

schemacs opened this issue · comments

$ python2
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipaddress
>>> ipaddress.ip_address(u'127.0.0.1').is_private
False

$ python3
Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipaddress
>>> ipaddress.ip_address(u'127.0.0.1').is_private
True

Thank you for the report! Originally, ipaddress was planned as a one-time sync. I've rectified that in v1.0.8 and synced to the newest upstream version.