carsonyl / pypac

Find and use proxy auto-config (PAC) files with Python and Requests.
https://pypac.readthedocs.io
Apache License 2.0
71 stars 19 forks source link

Fail silently if an error is raised trying to get a recognized TLD #39

Closed santiavenda2 closed 3 years ago

santiavenda2 commented 5 years ago

If we get any kind of errors trying to get a TLD we should use the fully-qualified hostname rightmost part as TLD

carsonyl commented 5 years ago

Thanks for the pull request. Do you have an example that triggers this error?

santiavenda2 commented 5 years ago

@carsonyl yes, I have an example

I'm having an error updating the TLD local file, raising a TldIOError https://github.com/barseghyanartur/tld/blob/master/src/tld/utils.py#L170

This exception is not catched and the method proxy_urls_from_dns dont try to use the hostname rightmost part as TLD.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-1.4%) to 87.5% when pulling 234f77548c77d291a13b014163c3cee87b9e1683 on InvGate:fail_silently_on_tld_errors into 9e14a9e84a1ec5513a4fa819573073942fed0980 on carsonyl:master.