Page MenuHomePhabricator

ipaddr 2.1.10 fails ip tests
Closed, ResolvedPublic

Description

python package ipaddr 2.1.10 fails two of the IP tests

2 of 494 tests failed:
"02001:0000:1234:0000:0000:C1C0:ABCD:0876" match should be False - not OK
"2001:0000:1234:0000:00001:C1C0:ABCD:0876" match should be False - not OK

This is the ipaddr that is part of debian wheezy. Given it is in a stable, and has a low error rate, it could be considered acceptable.

However, 2.1.6-2.1.9 fail 17 additional tests

"02001:0000:1234:0000:0000:C1C0:ABCD:0876" match should be False - not OK
"2001:0000:1234:0000:00001:C1C0:ABCD:0876" match should be False - not OK
" 2001:0000:1234:0000:0000:C1C0:ABCD:0876" match should be False - not OK
"2001:0000:1234:0000:0000:C1C0:ABCD:0876 " match should be False - not OK
" 2001:0000:1234:0000:0000:C1C0:ABCD:0876 " match should be False - not OK
"2001:0000:1234: 0000:0000:C1C0:ABCD:0876" match should be False - not OK
"fe80:0000:0000:0000:0204:61ff:254.157.241.086" match should be False - not OK
"1:2:3::4:5:6:7:8:9" match should be False - not OK
"1111:2222:3333:4444:5555:6666:7777:8888::" match should be False - not OK
"::2222:3333:4444:5555:6666:7777:8888:9999" match should be False - not OK
"1111:2222:3333:4444:5555:6666:7777:8888:1.2.3.4" match should be False - not OK
"1111:2222:3333:4444:5555:6666:7777:1.2.3.4" match should be False - not OK
"1111:2222:3333:4444:5555:6666::1.2.3.4" match should be False - not OK
"::2222:3333:4444:5555:6666:7777:1.2.3.4" match should be False - not OK
"1111:2222:3333:4444:5555:1.2.3.4" match should be False - not OK
"1111:2222:3333:4444:1.2.3.4" match should be False - not OK
"1111:2222:3333:1.2.3.4" match should be False - not OK
"1111:2222:1.2.3.4" match should be False - not OK
"1111:1.2.3.4" match should be False - not OK

Unfortunately 2.1.5 is the debian squeeze version, and it is not easily installed via pip.

fwiw, ipaddr 1.x doesnt include an IPAddress function.

Event Timeline

jayvdb claimed this task.
jayvdb raised the priority of this task from to Low.
jayvdb updated the task description. (Show Details)
jayvdb added a project: Pywikibot-tests.
jayvdb subscribed.

Change 224020 had a related patch set uploaded (by John Vandenberg):
Enable use-system-packages for Python 2.7

https://gerrit.wikimedia.org/r/224020

As an aside, the ipaddr package was whitelisted for the purpose of running tests against a 'distro' environment: https://github.com/travis-ci/travis-ci/issues/3973

And 2.1.11 does not fail these two tests?

And 2.1.11 does not fail these two tests?

That is the version that our py2 builds are using now.
https://travis-ci.org/wikimedia/pywikibot-core/jobs/70310593#L247

Hmm. Redhat Enterprise Linux has ipaddr-2.1.9, which isnt available on pypi (any longer?) at https://pypi.python.org/simple/ipaddr/ , and the SRPM references http://ipaddr-py.googlecode.com/files/ as the download link, but that is a 404.

http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/python-ipaddr-2.1.9-3.el6.src.rpm

It should be similar to https://github.com/google/ipaddr-py/tree/master/tags/2.1.9 (eww , svn in git)

I'll test 2.1.9, to see if it may be supportable.

jayvdb set Security to None.

I'll test 2.1.9, to see if it may be supportable.

So RHEL's ipaddr 2.1.9 is as bad as debian squeeze's 2.1.5.

Are those errors worth considering acceptable?
IMO no; the regex is better.

tools.ip doesnt do version checking, so it will use any version of ipaddr that is installed.
Perhaps tools.ip needs to do version checking, so that it can fall back to using the regex instead of the module.

Change 224020 merged by jenkins-bot:
Only allow ipaddr 2.1.10

https://gerrit.wikimedia.org/r/224020

Change 566013 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [deps] require ipaddress for Python 2

https://gerrit.wikimedia.org/r/566013

Change 566013 merged by jenkins-bot:
[pywikibot/core@master] [deps] require ipaddress for Python 2

https://gerrit.wikimedia.org/r/566013