-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.0 creates permission error on .suffix_cache #209
Comments
This file/folder used to be called *To much confusion. See this comment and related issues. |
I suppose the stacktrace could log the same helpful hint as here. tldextract/tldextract/cache.py Lines 62 to 65 in 8782832
|
never did anything special w/ .tld_set/etc... we don't have a direct dependency on tldextract so we never did anything around it. we get tldextract from this code: https://github.com/codelucas/newspaper which has this dependency setup:
|
(for now I just manually added tldextract==2.2.3 dependency into my requirements.txt to get around this - please feel free to close this bug unless you think there are any fixes necessary - thx. |
Hi, I'm having this issue on the |
Same issue here. And it's a bit troubling as I'm using this module in a Django project with celery. The Django processes are running in a different account than the celery project and I can't run the project right now. Maybe a more decoupled approach would be a better fit. I understand why you want to cache the file but I don't understand why you want the refresh the content each time the module is imported. It somehow feels more natural to use the cached downloads when it's there. So here's what I did to get it working in my setup:
|
Right, that is unintended. It's supposed to log the permission error then work with what it has. I guess it's an uncaught error, so subsequent re-imports re-raise? |
Fixes #209. * Move makedir side-effect from string building helper function into try block * Duplicate warning from writing a single cache file * Log this at most once per app
@bastbnl @aleprovencio @jaz2038 @falonso-caa @ivomac @Dophin2009 @vgrabovets Apologies for this issue caused by my recent changes. I'd like to be able to recreate this error so I can be confident we have addressed it. Would you be willing to share any of the following details of your build environment?
|
Just thought I would leave a comment letting you know I am also having the same issue had to downgrade to version 2.2.3-1 to resolve the issue when I get back I will post the information you requested. I don't have the info with me but the original permission error for .suffix_cache did not exist that location in the error. If there is anything else I can supply to help please let me know. |
@brycedrennan I reinstalled with
Let me know if there's anything I can do to help. |
Thanks for the info. I setup an arch linux instance and recreated the error. It's caused by installing python and tldextract using I don't understand how but there is a |
Confirmed archlinux previously added a workaround to the package: |
@john-kurkowski yes I think using something like appdirs could help out here. Will investigate more. I also wonder if we should change the default behavior to not update the list - make it something that you can manually call. That's what they did on archlinux. |
That makes sense.
I second using something like |
Sounds good. Unfortunately We could probably still use XDG_CACHE_HOME. Not sure how I feel about a shared cache across virtualenvs. |
@brycedrennan do you still need the python version, how it was installed, etc? I was considering my options using the caching approach and I think it would increase the ways I can use the module. It would be great if the caching engine would be pluggable, so I can write an engine for the project I'm working on and just cache the tlds. I could create one that uses the Django cache with the benefit of only downloading the tlds once for every engine working with the same cache instance |
Thanks ! Was going crazy about this one. Will lock it up until there's a fix. Also happy to sponsor whomever is taking care of this project a couple coffees :-) |
@bastbnl if you're not on arch linux then yes it would be helpful to know what environment you're having difficulty |
3.0.2 should catch the error and log a warning, instead of the uncaught error. |
On 2nd thought, the OP's bug should be fixed. People can use 3.x again, as they did 2.x. We can close this. Let's track redesign discussions in #212. |
We had a python dependency on a package that had a dependency on tldextract > 2.0. Our build pipeline has been pulling in tldextract 2.3, but today it pulled in 3.0 and we started getting this exception in our environment:
File "/usr/local/lib/python3.7/site-packages/tldextract/cache.py", line 104, in run_and_cache
cache_filepath = self._key_to_cachefile_path(namespace, key_args)
File "/usr/local/lib/python3.7/site-packages/tldextract/cache.py", line 95, in _key_to_cachefile_path
_make_dir(cache_path)
File "/usr/local/lib/python3.7/site-packages/tldextract/cache.py", line 155, in _make_dir
os.makedirs(os.path.dirname(filename))
File "/usr/local/lib/python3.7/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/local/lib/python3.7/os.py", line 223, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.7/site-packages/tldextract/.suffix_cache'
The text was updated successfully, but these errors were encountered: