python-whois icon indicating copy to clipboard operation
python-whois copied to clipboard

.com parsing fails for IANA domains

Open WKobes opened this issue 4 years ago • 2 comments

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:

  1. Query to example.com
  2. Try to access .__dict__

Expected behavior Should deal with the IANA format

WKobes avatar Apr 13 '21 11:04 WKobes

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__'?

senf666 avatar May 18 '22 15:05 senf666

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

maarten-boot avatar Jun 10 '22 11:06 maarten-boot

should be fixed by pull request: #230

maarten-boot avatar Nov 03 '22 12:11 maarten-boot

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 ;-)

maarten-boot avatar Nov 04 '22 11:11 maarten-boot

fixed now in https://github.com/DannyCork/python-whois/pull/233

maarten-boot avatar Nov 07 '22 09:11 maarten-boot