--- a/setup.py Wed Mar 02 10:36:21 2016 +0000
+++ b/setup.py Wed Mar 16 15:18:36 2016 +0100
@@ -1,7 +1,7 @@
import sys, os
import setuptools
-version = '0.6'
+version = '0.6.1'
setuptools.setup(
name='python-whois',
--- a/whois/whois.py Wed Mar 02 10:36:21 2016 +0000
+++ b/whois/whois.py Wed Mar 16 15:18:36 2016 +0100
@@ -38,9 +38,6 @@
import optparse
-def enforce_ascii(a):
- return a if isinstance(a, bytes) else bytes([63 if ord(c) > 127 else ord(c) for c in a]).decode('ascii')
-
class NICClient(object):
ABUSEHOST = "whois.abuse.net"
@@ -123,14 +120,15 @@
return ''
else:
nhost = None
- response = enforce_ascii(response)
+ response = response.decode('utf-8')
if b'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)
+ nhost = self.findwhois_server(response, hostname, query)
if nhost is not None:
- response += self.whois(query, nhost, 0).encode('utf-8')
- return response.decode()
+ response += self.whois(query, nhost, 0)
+ return response
+
def choose_server(self, domain):
"""Choose initial lookup NIC host"""