Hello community,
here is the log from the commit of package python-python-whois for
openSUSE:Factory checked in at 2018-05-11 14:27:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-whois (Old)
and /work/SRC/openSUSE:Factory/.python-python-whois.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-whois"
Fri May 11 14:27:53 2018 rev:2 rq:603208 version:0.7.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-python-whois/python-python-whois.changes
2017-12-14 11:00:02.608199201 +0100
+++
/work/SRC/openSUSE:Factory/.python-python-whois.new/python-python-whois.changes
2018-05-11 14:27:55.348860669 +0200
@@ -1,0 +2,17 @@
+Sun Apr 29 17:34:24 UTC 2018 - [email protected]
+
+- update to version 0.7.0:
+ * support for .lu, cz
+ * fix for .eu
+
+-------------------------------------------------------------------
+Wed Mar 21 19:34:15 UTC 2018 - [email protected]
+
+- update typo version 0.6.9:
+ * fix .me
+- update typo version 0.6.8:
+ * support for .cat, .ie, .space, .nz
+ * dealing with multiple dates improved
+ * fixes for Python 3
+
+-------------------------------------------------------------------
Old:
----
python-whois-0.6.7.tar.gz
New:
----
python-whois-0.7.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-whois.spec ++++++
--- /var/tmp/diff_new_pack.L48HEn/_old 2018-05-11 14:27:56.416821866 +0200
+++ /var/tmp/diff_new_pack.L48HEn/_new 2018-05-11 14:27:56.420821721 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-python-whois
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -13,20 +13,21 @@
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-python-whois
-Version: 0.6.7
+Version: 0.7.0
Release: 0
-License: MIT
Summary: Whois querying and parsing of domain registration information
-Url: https://bitbucket.org/richardpenman/pywhois
+License: MIT
Group: Development/Languages/Python
+Url: https://bitbucket.org/richardpenman/pywhois
Source:
https://files.pythonhosted.org/packages/source/p/python-whois/python-whois-%{version}.tar.gz
-BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
+BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module future}
BuildRequires: %{python_module nose}
++++++ python-whois-0.6.7.tar.gz -> python-whois-0.7.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.6.7/PKG-INFO
new/python-whois-0.7.0/PKG-INFO
--- old/python-whois-0.6.7/PKG-INFO 2017-12-02 00:18:24.000000000 +0100
+++ new/python-whois-0.7.0/PKG-INFO 2018-04-24 17:32:19.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-whois
-Version: 0.6.7
+Version: 0.7.0
Summary: Whois querying and parsing of domain registration information.
Home-page: https://bitbucket.org/richardpenman/pywhois
Author: Richard Penman
@@ -15,3 +15,5 @@
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.6.7/python_whois.egg-info/PKG-INFO
new/python-whois-0.7.0/python_whois.egg-info/PKG-INFO
--- old/python-whois-0.6.7/python_whois.egg-info/PKG-INFO 2017-12-02
00:18:24.000000000 +0100
+++ new/python-whois-0.7.0/python_whois.egg-info/PKG-INFO 2018-04-24
17:32:18.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-whois
-Version: 0.6.7
+Version: 0.7.0
Summary: Whois querying and parsing of domain registration information.
Home-page: https://bitbucket.org/richardpenman/pywhois
Author: Richard Penman
@@ -15,3 +15,5 @@
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.6.7/setup.cfg
new/python-whois-0.7.0/setup.cfg
--- old/python-whois-0.6.7/setup.cfg 2017-12-02 00:18:24.000000000 +0100
+++ new/python-whois-0.7.0/setup.cfg 2018-04-24 17:32:19.000000000 +0200
@@ -1,5 +1,4 @@
[egg_info]
tag_build =
tag_date = 0
-tag_svn_revision = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.6.7/setup.py
new/python-whois-0.7.0/setup.py
--- old/python-whois-0.6.7/setup.py 2017-12-02 00:16:20.000000000 +0100
+++ new/python-whois-0.7.0/setup.py 2018-04-24 17:31:12.000000000 +0200
@@ -1,7 +1,7 @@
import sys, os
import setuptools
-version = '0.6.7'
+version = '0.7.0'
setuptools.setup(
name='python-whois',
@@ -17,7 +17,9 @@
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
- 'Topic :: Internet :: WWW/HTTP'
+ 'Topic :: Internet :: WWW/HTTP',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 3',
],
keywords='whois, python',
author='Richard Penman',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.6.7/test/test_parser.py
new/python-whois-0.7.0/test/test_parser.py
--- old/python-whois-0.6.7/test/test_parser.py 2017-12-01 22:39:14.000000000
+0100
+++ new/python-whois-0.7.0/test/test_parser.py 2018-03-13 16:48:56.000000000
+0100
@@ -25,15 +25,15 @@
def test_com_expiration(self):
data = """
Status: ok
- Updated Date: 14-apr-2008
- Creation Date: 14-apr-2008
- Expiration Date: 14-apr-2009
+ Updated Date: 2017-03-31T07:36:34Z
+ Creation Date: 2013-02-21T19:24:57Z
+ Registry Expiry Date: 2018-02-21T19:24:57Z
>>> Last update of whois database: Sun, 31 Aug 2008 00:18:23 UTC <<<
"""
w = WhoisEntry.load('urlowl.com', data)
expires = w.expiration_date.strftime('%Y-%m-%d')
- self.assertEqual(expires, '2009-04-14')
+ self.assertEqual(expires, '2018-02-21')
def test_cast_date(self):
dates = ['14-apr-2008', '2008-04-14']
@@ -53,7 +53,9 @@
'creation_date', 'status']
fail = 0
total = 0
- for path in glob('test/samples/whois/*.com'):
+ whois_path =
os.path.join(os.path.dirname(os.path.abspath(__file__)),'samples','whois','*')
+ expect_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'samples','expected')
+ for path in glob(whois_path):
# Parse whois data
domain = os.path.basename(path)
with open(path) as whois_fp:
@@ -72,20 +74,27 @@
return str(obj)
raise TypeError(
'{} is not JSON serializable'.format(repr(obj)))
- outfile_name = os.path.join('test/samples/expected/', domain)
+ outfile_name = os.path.join(expect_path, domain)
with open(outfile_name, 'w') as outfil:
expected_results = json.dump(results, outfil,
default=date2str4json)
continue
# Load expected result
- with open(os.path.join('test/samples/expected/', domain)) as infil:
+ with open(os.path.join(expect_path, domain)) as infil:
expected_results = json.load(infil)
# Compare each key
- for key in results:
+ for key in set(results).union(set(expected_results)):
total += 1
+ if key not in results:
+ print("%s \t(%s):\t Missing in results" % (domain, key,))
+ fail += 1
+ continue
+
result = results.get(key)
+ if isinstance(result, list):
+ result = [str(element) for element in result]
if isinstance(result, datetime.datetime):
result = str(result)
expected = expected_results.get(key)
@@ -232,6 +241,64 @@
}
self._parse_and_compare('python.org.il', data, expected_results)
+ def test_ie_parse(self):
+ data = """
+ domain: rte.ie
+ descr: RTE Commercial Enterprises Limited
+ descr: Body Corporate (Ltd,PLC,Company)
+ descr: Corporate Name
+ admin-c: AWB910-IEDR
+ admin-c: JM474-IEDR
+ tech-c: JM474-IEDR
+ registration: 11-February-2000
+ renewal: 31-March-2024
+ holder-type: Billable
+ locked: NO
+ ren-status: Active
+ in-zone: 1
+ nserver: ns1.rte.ie 162.159.0.73 2400:cb00:2049:1::a29f:49
+ nserver: ns2.rte.ie 162.159.1.73 2400:cb00:2049:1::a29f:149
+ nserver: ns3.rte.ie 162.159.2.27 2400:cb00:2049:1::a29f:21b
+ nserver: ns4.rte.ie 162.159.3.18 2400:cb00:2049:1::a29f:312
+ source: IEDR
+
+ person: Michael Kennedy
+ nic-hdl: AWB910-IEDR
+ source: IEDR
+
+ person: John Moylan
+ nic-hdl: JM474-IEDR
+ source: IEDR
+
+ person: John Moylan
+ nic-hdl: JM474-IEDR
+ source: IEDR"""
+
+ expected_results = {
+ "domain_name": "rte.ie",
+ "description": [
+ "RTE Commercial Enterprises Limited",
+ "Body Corporate (Ltd,PLC,Company)",
+ "Corporate Name"
+ ],
+ "source": "IEDR",
+ "creation_date": "2000-02-11 00:00:00",
+ "expiration_date": "2024-03-31 00:00:00",
+ "name_servers": [
+ "ns1.rte.ie 162.159.0.73 2400:cb00:2049:1::a29f:49",
+ "ns2.rte.ie 162.159.1.73 2400:cb00:2049:1::a29f:149",
+ "ns3.rte.ie 162.159.2.27 2400:cb00:2049:1::a29f:21b",
+ "ns4.rte.ie 162.159.3.18 2400:cb00:2049:1::a29f:312"
+ ],
+ "status": "Active",
+ "admin_id": [
+ "AWB910-IEDR",
+ "JM474-IEDR"
+ ],
+ "tech_id": "JM474-IEDR"
+ }
+ self._parse_and_compare('rte.ie', data, expected_results)
+
def _parse_and_compare(self, domain_name, data, expected_results):
results = WhoisEntry.load(domain_name, data)
fail = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.6.7/whois/__init__.py
new/python-whois-0.7.0/whois/__init__.py
--- old/python-whois-0.6.7/whois/__init__.py 2017-12-01 22:39:14.000000000
+0100
+++ new/python-whois-0.7.0/whois/__init__.py 2018-01-23 23:50:40.000000000
+0100
@@ -33,7 +33,7 @@
if command:
# try native whois command
r = subprocess.Popen(['whois', domain], stdout=subprocess.PIPE)
- text = r.stdout.read()
+ text = r.stdout.read().decode()
else:
# try builtin client
nic_client = NICClient()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.6.7/whois/parser.py
new/python-whois-0.7.0/whois/parser.py
--- old/python-whois-0.6.7/whois/parser.py 2017-12-01 22:39:14.000000000
+0100
+++ new/python-whois-0.7.0/whois/parser.py 2018-04-24 17:31:12.000000000
+0200
@@ -30,6 +30,7 @@
KNOWN_FORMATS = [
'%d-%b-%Y', # 02-jan-2000
+ '%d-%B-%Y', # 11-February-2000
'%d-%m-%Y', # 20-10-2000
'%Y-%m-%d', # 2000-01-02
'%d.%m.%Y', # 2.1.2000
@@ -42,6 +43,7 @@
'%d-%b-%Y %H:%M:%S %Z', # 24-Jul-2009 13:20:03 UTC
'%a %b %d %H:%M:%S %Z %Y', # Tue Jun 21 23:59:59 GMT 2011
'%Y-%m-%dT%H:%M:%SZ', # 2007-01-26T19:10:31Z
+ '%Y-%m-%dT%H:%M:%S.%fZ', # 2018-12-01T16:17:30.568Z
'%Y-%m-%dT%H:%M:%S%z', # 2013-12-06T08:17:22-0800
'%Y-%m-%d %H:%M:%SZ', # 2000-08-22 18:55:20Z
'%Y-%m-%d %H:%M:%S', # 2000-08-22 18:55:20
@@ -50,6 +52,7 @@
'%d/%m/%Y %H:%M:%S %Z', # 23/04/2015 12:00:07 EEST
'%d/%m/%Y %H:%M:%S.%f %Z', # 23/04/2015 12:00:07.619546 EEST
'%B %d %Y', # August 14 2017
+ '%d.%m.%Y %H:%M:%S', # 08.03.2014 10:28:24
]
@@ -266,10 +269,32 @@
return WhoisIl(domain, text)
elif domain.endswith('.in'):
return WhoisIn(domain, text)
+ elif domain.endswith('.cat'):
+ return WhoisCat(domain, text)
+ elif domain.endswith('.ie'):
+ return WhoisIe(domain, text)
+ elif domain.endswith('.nz'):
+ return WhoisNz(domain, text)
+ elif domain.endswith('.space'):
+ return WhoisSpace(domain, text)
+ elif domain.endswith('.lu'):
+ return WhoisLu(domain, text)
+ elif domain.endswith('.cz'):
+ return WhoisCz(domain, text)
else:
return WhoisEntry(domain, text)
+class WhoisSpace(WhoisEntry):
+ """Whois parser for .space domains
+ """
+ def __init__(self, domain, text):
+ if 'No match for "' in text:
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text)
+
+
class WhoisCom(WhoisEntry):
"""Whois parser for .com domains
"""
@@ -321,6 +346,7 @@
'registrar': 'registrar: *(.+)',
'creation_date': 'created: *(.+)',
'expiration_date': 'paid-till: *(.+)',
+ 'updated_date': None,
'name_servers': 'nserver: *(.+)', # list of name servers
'status': 'state: *(.+)', # list of statuses
'emails': EMAIL_REGEX, # list of email addresses
@@ -338,6 +364,11 @@
"""Whois parser for .nl domains
"""
regex = {
+ 'domain_name': 'Domain Name: *(.+)',
+ 'expiration_date': None,
+ 'updated_date': None,
+ 'creation_date': None,
+ 'status': 'Status: *(.+)', # list of statuses
'name': None,
'address': None,
'zip_code': None,
@@ -361,7 +392,6 @@
self['country'] = lines[-1]
-
class WhoisName(WhoisEntry):
"""Whois parser for .name domains
"""
@@ -454,9 +484,9 @@
'name_servers': 'Name Server: *(.+)', # list of
name servers
'created_by_registrar': 'Created by Registrar: *(.+)',
'last_updated_by_registrar': 'Last Updated by Registrar: *(.+)',
- 'creation_date': 'Domain Registration Date: *(.+)',
- 'expiration_date': 'Domain Expiration Date: *(.+)',
- 'updated_date': 'Domain Last Updated Date: *(.+)',
+ 'creation_date': 'Creation Date: *(.+)',
+ 'expiration_date': 'Registry Expiry Date: *(.+)',
+ 'updated_date': 'Updated Date: *(.+)',
}
def __init__(self, domain, text):
@@ -519,7 +549,7 @@
'domain_name': 'Domain Name:(.+)',
'creation_date': 'Creation Date:(.+)',
'updated_date': 'Updated Date:(.+)',
- 'expiration_date': 'Registry Expiry Date: :(.+)',
+ 'expiration_date': 'Registry Expiry Date: (.+)',
'registrar': 'Registrar:(.+)',
'status': 'Domain Status:(.+)', # list of
statuses
'registrant_id': 'Registrant ID:(.+)',
@@ -602,6 +632,8 @@
class WhoisFr(WhoisEntry):
"""Whois parser for .fr domains
"""
+ dayfirst = True
+
regex = {
'domain_name': 'domain: *(.+)',
'registrar': 'registrar: *(.+)',
@@ -694,7 +726,7 @@
'tech_fax': r'Technical: *Name: *[^\n\r]+\s*Organisation:
*[^\n\r]+\s*Language: *[^\n\r]+\s*Phone: *[^\n\r]+\s*Fax: *([^\n\r]+)',
'tech_email': r'Technical: *Name: *[^\n\r]+\s*Organisation:
*[^\n\r]+\s*Language: *[^\n\r]+\s*Phone: *[^\n\r]+\s*Fax: *[^\n\r]+\s*Email:
*([^\n\r]+)',
'registrar': r'Registrar: *Name: *([^\n\r]+)',
- 'name_servers': r'Name servers: *([^\n\r]+)\s*([^\n\r]*)', # list of
name servers
+ 'name_servers': r'Name servers:\s*(.+)', # list of name servers
}
def __init__(self, domain, text):
@@ -811,9 +843,10 @@
"""Whois parser for .bg domains
"""
regex = {
+ 'domain_name': 'DOMAIN NAME: *(.+)\n',
+ 'status': 'registration status: s*(.+)',
'expiration_date': 'expires at: *(.+)',
}
-
dayfirst = True
def __init__(self, domain, text):
@@ -827,6 +860,8 @@
"""Whois parser for .de domains
"""
regex = {
+ 'domain_name': 'Domain: *(.+)',
+ 'status': 'Status: *(.+)',
'name': 'name: *(.+)',
'org': 'Organisation: *(.+)',
'address': 'Address: *(.+)',
@@ -849,6 +884,7 @@
"""Whois parser for .at domains
"""
regex = {
+ 'domain_name': 'domain: *(.+)',
'name': 'personname: *(.+)',
'org': 'organization: *(.+)',
'address': 'street address: *(.+)',
@@ -1264,7 +1300,6 @@
'registrar': 'registrar name: *(.+)',
'referral_url': 'registrar info: *(.+)',
}
-
dayfirst = True
def __init__(self, domain, text):
@@ -1297,3 +1332,130 @@
raise PywhoisError(text)
else:
WhoisEntry.__init__(self, domain, text, self.regex)
+
+class WhoisCat(WhoisEntry):
+ """Whois parser for .cat domains
+ """
+ regex = {
+ 'domain_name': 'Domain Name: *(.+)',
+ 'registrar': 'Registrar: *(.+)',
+ 'updated_date': 'Updated Date: *(.+)',
+ 'creation_date': 'Creation Date: *(.+)',
+ 'expiration_date': 'Registry Expiry Date: *(.+)',
+ 'name_servers': 'Name Server: *(.+)',
+ 'status': 'Domain status: *(.+)',
+ 'emails': EMAIL_REGEX,
+ }
+
+ def __init__(self, domain, text):
+ if 'no matching objects' in text:
+ raise PywhoisError(text)
+ else:
+ # Merge base class regex with specifics
+ self._regex.copy().update(self.regex)
+ self.regex = self._regex
+ WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisIe(WhoisEntry):
+ """Whois parser for .ie domains
+ """
+ regex = {
+ 'domain_name': 'domain: *(.+)',
+ 'description': 'descr: *(.+)',
+ 'source': 'Source: *(.+)',
+ 'creation_date': 'registration: *(.+)',
+ 'expiration_date': 'renewal: *(.+)',
+ 'name_servers': 'nserver: *(.+)',
+ 'status': 'ren-status: *(.+)',
+ 'admin_id': 'admin-c: *(.+)',
+ 'tech_id': 'tech-c: *(.+)'
+ }
+
+ def __init__(self, domain, text):
+ if 'no matching objects' in text:
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisNz(WhoisEntry):
+ """Whois parser for .nz domains
+ """
+ regex = {
+ 'domain_name': 'domain_name:\s*([^\n\r]+)',
+ 'registrar': 'registrar_name:\s*([^\n\r]+)',
+ 'updated_date': 'domain_datelastmodified:\s*([^\n\r]+)',
+ 'creation_date': 'domain_dateregistered:\s*([^\n\r]+)',
+ 'expiration_date': 'domain_datebilleduntil:\s*([^\n\r]+)',
+ 'name_servers': 'ns_name_\d*:\s*([^\n\r]+)', # list of name
servers
+ 'status': 'status:\s*([^\n\r]+)', # list of statuses
+ 'emails': EMAIL_REGEX, # list of email s
+ 'name': 'registrant_contact_name:\s*([^\n\r]+)',
+ 'address': 'registrant_contact_address\d*:\s*([^\n\r]+)',
+ 'city': 'registrant_contact_city:\s*([^\n\r]+)',
+ 'zipcode': 'registrant_contact_postalcode:\s*([^\n\r]+)',
+ 'country': 'registrant_contact_country:\s*([^\n\r]+)',
+ }
+
+ def __init__(self, domain, text):
+ if 'no matching objects' in text:
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisLu(WhoisEntry):
+ """Whois parser for .lu domains
+ """
+ regex = {
+ 'domain_name': 'domainname: *(.+)',
+ 'creation_date': 'registered: *(.+)',
+ 'name_servers': 'nserver: *(.+)',
+ 'status': 'domaintype: *(.+)',
+ 'registrar': 'registrar-name: *(.+)',
+ 'registrant_name': 'org-name: *(.+)',
+ 'registrant_address': 'org-address: *(.+)',
+ 'registrant_postal_code': 'org-zipcode:*(.+)',
+ 'registrant_city': 'org-city: *(.+)',
+ 'registrant_country': 'org-country: *(.+)',
+ 'admin_name': 'adm-name: *(.+)',
+ 'admin_address': 'adm-address: *(.+)',
+ 'admin_postal_code': 'adm-zipcode: *(.+)',
+ 'admin_city': 'adm-city: *(.+)',
+ 'admin_country': 'adm-country: *(.+)',
+ 'admin_email': 'adm-email: *(.+)',
+ 'tech_name': 'tec-name: *(.+)',
+ 'tech_address': 'tec-address: *(.+)',
+ 'tech_postal_code': 'tec-zipcode: *(.+)',
+ 'tech_city': 'tec-city: *(.+)',
+ 'tech_country': 'tec-country: *(.+)',
+ 'tech_email': 'tec-email: *(.+)',
+ }
+
+ def __init__(self, domain, text):
+ if 'No such domain' in text:
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisCz(WhoisEntry):
+ """Whois parser for .cz domains
+ """
+ regex = {
+ 'domain_name': 'domain: *(.+)',
+ 'registrant_name': 'registrant: *(.+)',
+ 'registrar': 'registrar: *(.+)',
+ 'creation_date': 'registered: *(.+)',
+ 'updated_date': 'changed: *(.+)',
+ 'expiration_date': 'expire: *(.+)',
+ 'name_servers': 'nserver: *(.+)',
+ }
+
+ def __init__(self, domain, text):
+ if '% No entries found.' in text:
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.6.7/whois/whois.py
new/python-whois-0.7.0/whois/whois.py
--- old/python-whois-0.6.7/whois/whois.py 2017-12-01 22:39:14.000000000
+0100
+++ new/python-whois-0.7.0/whois/whois.py 2018-02-14 19:24:39.000000000
+0100
@@ -75,7 +75,7 @@
whois server for getting contact details.
"""
nhost = None
- match = re.compile('Domain Name: ' + query + '\s*.*?Whois Server:
(.*?)\s', flags=re.IGNORECASE|re.DOTALL).search(buf)
+ match = re.compile('Domain Name: {}\s*.*?Whois Server:
(.*?)\s'.format(query), flags=re.IGNORECASE|re.DOTALL).search(buf)
if match:
nhost = match.groups()[0]
# if the whois address is domain.tld/something then
@@ -97,34 +97,31 @@
there for contact details
"""
response = b''
- try:
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.settimeout(10)
- s.connect((hostname, 43))
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ s.settimeout(10)
+ s.connect((hostname, 43))
- try:
- query = query.decode('utf-8')
- except UnicodeEncodeError:
- pass # Already Unicode (python2's error)
- except AttributeError:
- pass # Already Unicode (python3's error)
+ try:
+ query = query.decode('utf-8')
+ except UnicodeEncodeError:
+ pass # Already Unicode (python2's error)
+ except AttributeError:
+ pass # Already Unicode (python3's error)
- if hostname == NICClient.DENICHOST:
- query_bytes = "-T dn,ace -C UTF-8 " + query
- elif hostname.endswith(NICClient.QNICHOST_TAIL) and many_results:
- query_bytes = '=' + query
- else:
- query_bytes = query
- s.send(bytes(query_bytes,'utf-8') + b"\r\n")
- # recv returns bytes
- while True:
- d = s.recv(4096)
- response += d
- if not d:
- break
- s.close()
- except socket.error as socketerror:
- print('Socket Error:', socketerror)
+ if hostname == NICClient.DENICHOST:
+ query_bytes = "-T dn,ace -C UTF-8 " + query
+ elif hostname.endswith(NICClient.QNICHOST_TAIL) and many_results:
+ query_bytes = '=' + query
+ else:
+ query_bytes = query
+ s.send(bytes(query_bytes,'utf-8') + b"\r\n")
+ # recv returns bytes
+ while True:
+ d = s.recv(4096)
+ response += d
+ if not d:
+ break
+ s.close()
nhost = None
response = response.decode('utf-8', 'replace')