diff --git a/.gitignore b/.gitignore index d90a153a..9a16b660 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ tldextract.egg-info .envrc tldextract/.suffix_cache/* .pytest_cache +.python-version diff --git a/tldextract/utils.py b/tldextract/utils.py index aba8584f..76604ecb 100644 --- a/tldextract/utils.py +++ b/tldextract/utils.py @@ -27,7 +27,7 @@ def return_cache(*args, **kwargs): make_dir(cache_path) - # without locking, Concurrency could leader to multiple writers, or readers of a partial write + # locking used to prevent concurrent writes, or reads of a partially written file with FileLock(lock_path, timeout=20): if not os.path.isfile(cache_path): result = func(*args, **kwargs)