--- a/setup.py Tue Sep 08 11:09:27 2015 +0800
+++ b/setup.py Mon Sep 14 15:13:50 2015 +0100
@@ -1,7 +1,7 @@
import sys, os
import setuptools
-version = '0.5'
+version = '0.5.1'
setuptools.setup(
name='python-whois',
--- a/whois/parser.py Tue Sep 08 11:09:27 2015 +0800
+++ b/whois/parser.py Mon Sep 14 15:13:50 2015 +0100
@@ -296,12 +296,13 @@
match = re.compile('Registrar:(.*?)DNSSEC', re.DOTALL).search(text)
if match:
- lines = match.groups()[0].strip().splitlines()
- self.name = lines[0]
- self.address = lines[1]
+ lines = [line.strip() for line in match.groups()[0].strip().splitlines()]
+ self['name'] = lines[0]
+ self['address'] = lines[1]
if len(lines) == 4:
- self.zip_code, _, self.city = lines[2].partition(' ')
- self.country = lines[-1]
+ self['zip_code'], _, self['city'] = lines[2].partition(' ')
+ self['country'] = lines[-1]
+
class WhoisName(WhoisEntry):
--- a/whois/whois.py Tue Sep 08 11:09:27 2015 +0800
+++ b/whois/whois.py Mon Sep 14 15:13:50 2015 +0100
@@ -90,7 +90,7 @@
break
return nhost
- def whois(self, query, hostname, flags):
+ def whois(self, query, hostname, flags, many_results=False):
"""Perform initial lookup with TLD whois server
then, if the quick flag is false, search that result
for the region-specifc whois server and do a lookup
@@ -107,7 +107,7 @@
if hostname == NICClient.DENICHOST:
queryBytes = "-T dn,ace -C UTF-8 " + query
- elif hostname.endswith(NICClient.QNICHOST_TAIL):
+ elif hostname.endswith(NICClient.QNICHOST_TAIL) and many_results:
queryBytes = '=' + query
else:
queryBytes = query
@@ -121,9 +121,11 @@
break
s.close()
except socket.error as socketerror:
- print 'Error: ', socketerror
+ print 'Socket Error:', socketerror
nhost = None
response = enforce_ascii(response)
+ if 'with "=xxx"' in response:
+ return self.whois(query, hostname, flags, True)
if flags & NICClient.WHOIS_RECURSE and nhost is None:
nhost = self.findwhois_server(response.decode(), hostname, query)
if nhost is not None: