--- a/whois/__init__.py Wed Jan 09 09:00:47 2013 +1100
+++ b/whois/__init__.py Wed Jan 09 09:07:47 2013 +1100
@@ -10,7 +10,6 @@
# clean domain to expose netloc
domain = extract_domain(url)
try:
- raise OSError()
# try native whois command first
r = subprocess.Popen(['whois', domain], stdout=subprocess.PIPE)
text = r.stdout.read()
--- a/whois/parser.py Wed Jan 09 09:00:47 2013 +1100
+++ b/whois/parser.py Wed Jan 09 09:07:47 2013 +1100
@@ -65,9 +65,12 @@
"""
whois_regex = self._regex.get(attr)
if whois_regex:
- values = re.findall(whois_regex, self.text, re.IGNORECASE)
- # try casting to date format
- values = [cast_date(value.strip()) for value in values]
+ values = []
+ for value in re.findall(whois_regex, self.text, re.IGNORECASE):
+ if isinstance(value, basestring):
+ # try casting to date format
+ value = cast_date(value.strip())
+ values.append(value)
if len(values) == 1:
values = values[0]
setattr(self, attr, values)