When using satori as a library, netlocs without a tld will throw an exception
Bug #1295391 reported by
BK Box
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
satori |
Fix Committed
|
Medium
|
Unassigned |
Bug Description
When using satori as a library and a netloc such as IP, localhost, hostname are passed to `domain_info` an exception is raised. It appears to be because tldextract returns a blank string ('') which is then passed to pythonwhois, that fails to lookup the root WHOIS server on a blank string:
from satori.dns import domain_info
a = domain_
The result of that would be: "WhoisException: No root WHOIS server found for TLD."
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/82187 /git.openstack. org/cgit/ stackforge/ satori/ commit/ ?id=d649f19680a 0dae223de4318e4 607e0d3b96807e
Committed: https:/
Submitter: Jenkins
Branch: master
commit d649f19680a0dae 223de4318e4607e 0d3b96807e
Author: BK Box <email address hidden>
Date: Fri Mar 21 15:24:28 2014 -0500
Add exception `SatoriInvalidD omain`
When `domain_info` is passed an invalid domain, it would attempt to s.get_whois` . This causes an exception of "No root WHOIS
parse the registered domain and eventually pass a blank string to
`pythonwhoi
server found for TLD." This is a valid exception, but we should not make
it this far to get this exception.
Instead, this patch will raise an exception of `SatoriInvalidD omain` if
domain_info attempted to be used with an invalid domain.
Change-Id: Ie30b9a01b39d92 d8bfeb7f3a80d33 3fa4bb30d49
Closes-Bug: #1295391
Closes-Bug: #1293670