Closed Yama85 closed 1 year ago
Hey thanks for opening an issue and providing context around the exception.
It looks like the response from this registrar, ownregister.com, ownregistrar.com (edit), is not correctly implemented/not RDAP conformant.
Correct vcard array format (https://www.rfc-editor.org/rfc/rfc7483#section-5.1):
What is implemented here:
What it should be:
Additionally, this response has a case where "entities" is not an array, but an object:
Unfortunately, there's not much I can do besides file an RDAP conformance ticket with the registrar.
However, it would be reasonable to expect that this library should more gracefully handle situations like these. Although it's a losing battle to handle interpreting and parsing bad responses. @Yama85 From a user's perspective, do you have any preference on how the to_whois_dict
method should behave when it encounters misformatted data? Maybe it would be a good improvement to not "fail" (raise an exception) and instead set a flag somewhere about the rdap conformance problem? Let me know.
Network request worked successfully, however response processing failed with the following error:
Traceback (most recent call last):
File "asd.py", line 6, in main response = await asyncwhois.aio_rdap_domain('clientservices.scenber.com')
File "C:\Users\SAMPLE_USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\asyncwhois__init__.py", line 93, in aio_rdap_domain result = await DomainLookup.aio_rdap_domain(domain, httpx_client)
File "C:\Users\SAMPLE_USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\asyncwhois\pywhois.py", line 156, in aio_rdap_domain whois_dict = response.to_whois_dict()
File "C:\Users\SAMPLE_USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\whodap\response.py", line 190, in to_whois_dict flat.update(self._flat_entities(self.entities))
File "C:\Users\SAMPLE_USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\whodap\response.py", line 238, in _flat_entities vcard_type = vcard[0]
TypeError: 'DomainResponse' object is not subscriptable