When using satori as a library, netlocs without a tld will throw an exception

Bug #1295391 reported by BK Box on 2014-03-20
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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_info('')

The result of that would be: "WhoisException: No root WHOIS server found for TLD."

Reviewed: https://review.openstack.org/82187
Committed: https://git.openstack.org/cgit/stackforge/satori/commit/?id=d649f19680a0dae223de4318e4607e0d3b96807e
Submitter: Jenkins
Branch: master

commit d649f19680a0dae223de4318e4607e0d3b96807e
Author: BK Box <email address hidden>
Date: Fri Mar 21 15:24:28 2014 -0500

    Add exception `SatoriInvalidDomain`

    When `domain_info` is passed an invalid domain, it would attempt to
    parse the registered domain and eventually pass a blank string to
    `pythonwhois.get_whois`. This causes an exception of "No root WHOIS
    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 `SatoriInvalidDomain` if
    domain_info attempted to be used with an invalid domain.

    Change-Id: Ie30b9a01b39d92d8bfeb7f3a80d333fa4bb30d49
    Closes-Bug: #1295391
    Closes-Bug: #1293670

Changed in satori:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers