john-kurkowski / tldextract

Accurately separates a URL’s subdomain, domain, and public suffix, using the Public Suffix List (PSL).
BSD 3-Clause "New" or "Revised" License
1.81k stars 211 forks source link

Ocasional PermissionError when running tldextract.extract #277

Open bogdanpetrea opened 1 year ago

bogdanpetrea commented 1 year ago

Hi, I've encountered some ocasional PermissionError exceptions when calling tldextract.extract , but I'm not sure if this can be reproduced reliably.

I also mention that I'm running version 3.1, but I haven't seen any related fixes in the changelog. I'll upgrade to latest regardless.

Here are some logs from sentry:

Attempting to acquire lock XXX on /root/.cache/python-tldextract/3.9.12.final__local__xxx__tldextract-3.1.0/publicsuffix.org-tlds/xxx.tldextract.json.lock

PermissionError: [Errno 13] Permission denied: '/root/.cache/python-tldextract/3.9.12.final__local__xxx__tldextract-3.1.0/publicsuffix.org-tlds/xxx.tldextract.json.lock'
john-kurkowski commented 1 year ago

I wonder if it's related to #254? The occasional 20s+ network hang in reaching the Public Suffix List would explain the error. In that issue, unfortunately, the only workaround to silence the error is to disable fetching and/or caching the Public Suffix List.