You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the app with Tldextract runs
a) without the 'tld_set_snapshot' file
b) the logging is in DEBUG mode
c) there is no previously created 'cache_file' in the TLDEXTRACT_CACHE - defined location
then the application fails.
It looks like the failure is in the below code which, in this specific case, tries to get data from 'tld_set_snapshot' file which does not exists.
Workaround:
Switching logging to INFO causes the lib to download the fresh copy of 'cache_file' and it all works fine.
def _cache_tlds(self, tlds):
'''Logs a diff of the new TLDs and caches them on disk, according to
settings passed to __init__.'''
if LOG.isEnabledFor(logging.DEBUG):
import difflib
snapshot_data = pkgutil.get_data(__name__, '.tld_set_snapshot')
snapshot = sorted(json.loads(snapshot_data.decode('utf-8')))
new = sorted(tlds)
LOG.debug('computed TLD diff:\n%s', '\n'.join(difflib.unified_diff(
snapshot,
new,
fromfile=".tld_set_snapshot",
tofile=self.cache_file
)))
The text was updated successfully, but these errors were encountered:
If the app with Tldextract runs
a) without the 'tld_set_snapshot' file
b) the logging is in DEBUG mode
c) there is no previously created 'cache_file' in the TLDEXTRACT_CACHE - defined location
then the application fails.
It looks like the failure is in the below code which, in this specific case, tries to get data from 'tld_set_snapshot' file which does not exists.
Workaround:
Switching logging to INFO causes the lib to download the fresh copy of 'cache_file' and it all works fine.
The text was updated successfully, but these errors were encountered: