# HG changeset patch # User Richard Baron Penman # Date 1357682867 -39600 # Node ID 2bada1724be766e490f2c214fd8cfb4d13d3c34a # Parent f8d7b881701d74e12621b0336d6465574e098853 fixed tuple string patch diff -r f8d7b881701d -r 2bada1724be7 whois/__init__.py --- 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() diff -r f8d7b881701d -r 2bada1724be7 whois/parser.py --- 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)