Package: python3-tldextract
Version: 5.1.2-1
Severity: normal
X-Debbugs-Cc: [email protected]
Dear Maintainer,
When initiating and using TLDExtract with an empty suffix_list_urls,
subsequent calls fail. Please see the example:
>>> import tldextract
>>> extract = tldextract.TLDExtract(suffix_list_urls=())
>>> extract("debian.org")
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/tldextract/cache.py", line 209, in
run_and_cache
result = cast(T, self.get(namespace=namespace, key=key_args))
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/tldextract/cache.py", line 111, in get
raise KeyError("namespace: " + namespace + " key: " + repr(key))
KeyError: "namespace: publicsuffix.org-tlds key: {'urls': (),
'fallback_to_snapshot': True}"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/tldextract/suffix_list.py", line 104, in
_get_suffix_lists
text = find_first_response(
cache, urls, cache_fetch_timeout=cache_fetch_timeout, session=session
)
File "/usr/lib/python3/dist-packages/tldextract/suffix_list.py", line 56, in
find_first_response
raise SuffixListNotFound(
...<2 lines>...
)
tldextract.suffix_list.SuffixListNotFound: No remote Public Suffix List found.
Consider using a mirror, or avoid this fetch by constructing your TLDExtract
with `suffix_list_urls=()`.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
extract("debian.org")
~~~~~~~^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/tldextract/tldextract.py", line 228, in
__call__
return self.extract_str(url, include_psl_private_domains, session=session)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/tldextract/tldextract.py", line 257, in
extract_str
return self._extract_netloc(
~~~~~~~~~~~~~~~~~~~~^
lenient_netloc(url), include_psl_private_domains, session=session
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/lib/python3/dist-packages/tldextract/tldextract.py", line 308, in
_extract_netloc
suffix_index, is_private = self._get_tld_extractor(
~~~~~~~~~~~~~~~~~~~~~~~^
session=session
^^^^^^^^^^^^^^^
).suffix_index(labels,
include_psl_private_domains=include_psl_private_domains)
^
File "/usr/lib/python3/dist-packages/tldextract/tldextract.py", line 356, in
_get_tld_extractor
public_tlds, private_tlds = get_suffix_lists(
~~~~~~~~~~~~~~~~^
cache=self._cache,
^^^^^^^^^^^^^^^^^^
...<3 lines>...
session=session,
^^^^^^^^^^^^^^^^
)
^
File "/usr/lib/python3/dist-packages/tldextract/suffix_list.py", line 81, in
get_suffix_lists
return cache.run_and_cache(
~~~~~~~~~~~~~~~~~~~^
func=_get_suffix_lists,
^^^^^^^^^^^^^^^^^^^^^^^
...<8 lines>...
hashed_argnames=["urls", "fallback_to_snapshot"],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/lib/python3/dist-packages/tldextract/cache.py", line 211, in
run_and_cache
result = func(**kwargs)
File "/usr/lib/python3/dist-packages/tldextract/suffix_list.py", line 109, in
_get_suffix_lists
maybe_pkg_data = pkgutil.get_data("tldextract", ".tld_set_snapshot")
File "/usr/lib/python3.13/pkgutil.py", line 453, in get_data
return loader.get_data(resource_name)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap_external>", line 1217, in get_data
FileNotFoundError: [Errno 2] No such file or directory:
'/usr/lib/python3/dist-packages/tldextract/.tld_set_snapshot'
An empty suffix_list_urls is a perfectly valid option as can be seen in
https://github.com/john-kurkowski/tldextract?tab=readme-ov-file#note-about-caching
Best regards,
Michel Le Bihan
-- System Information:
Debian Release: forky/sid
APT prefers testing
APT policy: (700, 'testing'), (650, 'unstable'), (600, 'experimental'), (500,
'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.12.38+deb13-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-tldextract depends on:
ii python3 3.13.5-1
ii python3-filelock 3.18.0-1
ii python3-idna 3.10-1
ii python3-requests 2.32.3+dfsg-5
ii python3-requests-file 2.1.0-1
Versions of packages python3-tldextract recommends:
ii publicsuffix 20250328.1952-0.1
python3-tldextract suggests no packages.
-- no debconf information