--- a/test/test_main.py Sun Nov 26 01:04:03 2017 +0100
+++ b/test/test_main.py Thu Nov 30 23:17:45 2017 +0100
@@ -19,7 +19,7 @@
def test_ascii_with_schema_path_and_query(self):
url = 'https://www.google.com/search?q=why+is+domain+whois+such+a+mess'
- domain = 'www.google.com'
+ domain = 'google.com'
self.assertEqual(domain, extract_domain(url))
def test_simple_unicode_domain(self):
--- a/whois/__init__.py Sun Nov 26 01:04:03 2017 +0100
+++ b/whois/__init__.py Thu Nov 30 23:17:45 2017 +0100
@@ -79,17 +79,17 @@
if not isinstance(url, str):
url = url.decode('utf-8')
url = re.sub('^.*://', '', url)
- url = url.split('/')[0].lower().encode('idna')
+ url = url.split('/')[0].lower()
# find the longest suffix match
domain = b''
- for section in reversed(url.split(b'.')):
+ for section in reversed(url.split('.')):
if domain:
domain = b'.' + domain
- domain = section + domain
+ domain = section.encode('utf-8') + domain
if domain not in suffixes:
break
- return domain.decode('idna')
+ return domain.decode('utf-8')
if __name__ == '__main__':
--- a/whois/parser.py Sun Nov 26 01:04:03 2017 +0100
+++ b/whois/parser.py Thu Nov 30 23:17:45 2017 +0100
@@ -30,6 +30,7 @@
KNOWN_FORMATS = [
'%d-%b-%Y', # 02-jan-2000
+ '%d-%m-%Y', # 20-10-2000
'%Y-%m-%d', # 2000-01-02
'%d.%m.%Y', # 2.1.2000
'%Y.%m.%d', # 2000.01.02