joepie91 / python-whois

A python module for retrieving and parsing WHOIS data
Do What The F*ck You Want To Public License
398 stars 187 forks source link

ValueError: month must be in 1..12 #52

Open kirmandi opened 9 years ago

kirmandi commented 9 years ago
>>> pythonwhois.get_whois("ALBARELLI.NET")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pythonwhois/__init__.py", line 8, in get_whois
    return parse.parse_raw_whois(raw_data, normalized=normalized, never_query_handles=False, handle_server=server_list[-1])
  File "/usr/local/lib/python2.7/dist-packages/pythonwhois/parse.py", line 563, in parse_raw_whois
    data['expiration_date'] = parse_dates(data['expiration_date'])
  File "/usr/local/lib/python2.7/dist-packages/pythonwhois/parse.py", line 812, in parse_dates
    parsed_dates.append(datetime.datetime(year, day, month, hour, minute, second))
ValueError: month must be in 1..12

appeared on: ALBARELLI.NET normal whois gives the following data:

Domain name: ALBARELLI.NET
Registrar: Premium Registrations
[...]
Record created: 2013-06-26
Record expires: 0000-00-00
Name Server: p1.internetbolaget.se
Name Server: p2.internetbolaget.se

however this only appears on some whois server, others have updated information where the expire data is in a correct format and valid date

it would be nice if pythonwhois would not fail with an exception, but rather silently just ignore this wrong date

ashim888 commented 8 years ago

will this be solved any time soon?