.com parsing fails for IANA domains
Describe the bug
Domains registered under .com by IANA directly output a different format, thus causes the parsing to fail. An example is example.com. Instead for regular format, it has the following output:
domain: EXAMPLE.COM
organisation: Internet Assigned Numbers Authority
created: 1992-01-01
source: IANA
To Reproduce Steps to reproduce the behavior:
- Query to example.com
- Try to access
.__dict__
Expected behavior Should deal with the IANA format
verified
import whois
w = whois.query("example.com")
print(w.__dict__)
produces
print(w.__dict__)
AttributeError: 'NoneType' object has no attribute '__dict__'. Did you mean: '__dir__'?
i think this is actually a side effect of the construct on _2_parse.py
whois_splitted = whois_str.split("source: IANA")
if len(whois_splitted) == 2:
whois_str = whois_splitted[1]
for example.com there is nothing after this line so the result is NONE this is a special case
should be fixed by pull request: #230
i retracted #230 it introduced behaviour changes , reworking a new change set to handle this without introducing changes in the current behaviour, sorry for the confusion ;-)
fixed now in https://github.com/DannyCork/python-whois/pull/233