Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 410828 Details for
Bug 559366
dev-python/pyspf: incorrect usage of ipaddres/ipaddr
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ipaddress.patch
ipaddress.patch (text/plain), 1.72 KB, created by
Robert Trace
on 2015-09-02 04:58:35 UTC
(
hide
)
Description:
ipaddress.patch
Filename:
MIME Type:
Creator:
Robert Trace
Created:
2015-09-02 04:58:35 UTC
Size:
1.72 KB
patch
obsolete
># HG changeset patch ># Parent 5d2afb13dbe7beeabf791aa2d31955dbfb1f6ed6 > >diff -r 5d2afb13dbe7 spf.py >--- a/spf.py Tue Sep 01 20:14:27 2015 -0600 >+++ b/spf.py Tue Sep 01 21:03:10 2015 -0600 >@@ -102,10 +102,7 @@ > # Python standard libarary as of python3.3 > import ipaddress > except ImportError: >- try: >- import ipaddr as ipaddress >- except ImportError: >- print('ipaddr module required: http://code.google.com/p/ipaddr-py/') >+ print('ipaddress module required: https://github.com/phihag/ipaddress') > > import DNS # http://pydns.sourceforge.net > if not hasattr(DNS.Type, 'SPF'): >@@ -401,6 +398,9 @@ > self.iplist = [] > ip6 = True > else: >+ if sys.version_info.major < 3: >+ if isinstance(i, str): >+ i = i.decode('ascii') > try: > self.ipaddr = ipaddress.ip_address(i) > except AttributeError: >@@ -1203,7 +1203,7 @@ > 'No %s records found for'%A, domainname) > if A == 'AAAA' and bytes is str: > # work around pydns inconsistency plus python2 bytes/str ambiguity >- return [ipaddress.Bytes(ip) for ip in r] >+ return [ipaddress.ip_address(ip) for ip in r] > return r > > def validated_ptrs(self): >@@ -1345,6 +1345,11 @@ > True > """ > try: >+ if sys.version_info.major < 3: >+ for idx, ip in enumerate(ipaddrs): >+ if isinstance(ipaddrs[idx], str): >+ ipaddrs[idx] = ipaddrs[idx].decode('ascii') >+ > for netwrk in [ipaddress.ip_network(ip) for ip in ipaddrs]: > network = netwrk.supernet(new_prefix=n) > if isinstance(self.iplist, bool):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 559366
:
410814
|
410816
| 410828 |
410830