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
{{ message }}
Repository navigation
Package crashes if there is no permission to create the cache directory. #906
When trying to set the cache directory to a directory which exists, but where the directory it resides in does not allow the creation of a new directory, the package erroneously crashes:
Traceback (most recent call last):
File "01_create_commands.py", line 6, in <module>
from update_metadata_util import classification_tasks, regression_tasks
File "/tmp/auto-sklearn/scripts/update_metadata_util.py", line 2, in <module>
import openml
File "/home/feurerm/miniconda/3-4.5.4/envs/autosklearnmetadata/lib/python3.7/site-packages/openml/__init__.py", line 20, in <module>
from . import _api_calls
File "/home/feurerm/miniconda/3-4.5.4/envs/autosklearnmetadata/lib/python3.7/site-packages/openml/_api_calls.py", line 10, in <module>
from . import config
File "/home/feurerm/miniconda/3-4.5.4/envs/autosklearnmetadata/lib/python3.7/site-packages/openml/config.py", line 244, in <module>
_setup()
File "/home/feurerm/miniconda/3-4.5.4/envs/autosklearnmetadata/lib/python3.7/site-packages/openml/config.py", line 150, in _setup
os.mkdir(cache_directory)
PermissionError: [Errno 13] Permission denied: '/data/aad/openml/'
The directory is:
ls -al /data/aad
total 50127952
drwxr-sr-x 27 other other 4096 Mär 10 10:58 .
drwxr-xr-x 3 root root 0 Apr 9 09:42 ..
drwxr-xr-x 8 feurerm other 4096 Apr 8 13:24 openml
I would prefer supporting this. This happened on our local cluster, where I can't get write access to the directory the cache directory is in (opposed to your comment, this is about the directory the cache directory is in, not about the cache directory).
I couldn't find a reason that the PermissionError is raised over the FileExistsError, but it probably has to do with the OS checking in that order, which would make sense (so as not to leak information). I think checking before had (if not file exists) instead of asking for forgiveness (try:... except FileNotExists:...) should be enough to circumvent this. As long as we can write in the cache directory I don't foresee any issues.
Activity
PGijsbers commentedon Apr 20, 2020
Is this something we want to support? Or do you just want the user to have a better prompt that tells them to set write access to the cache directory?
mfeurer commentedon Apr 20, 2020
I would prefer supporting this. This happened on our local cluster, where I can't get write access to the directory the cache directory is in (opposed to your comment, this is about the directory the cache directory is in, not about the cache directory).
PGijsbers commentedon Apr 20, 2020
I couldn't find a reason that the
PermissionErroris raised over theFileExistsError, but it probably has to do with the OS checking in that order, which would make sense (so as not to leak information). I think checking before had (if not file exists) instead of asking for forgiveness (try:... except FileNotExists:...) should be enough to circumvent this. As long as we can write in the cache directory I don't foresee any issues.Fix #883 #884 #906 #972
Fix #883 #884 #906 #972
Rework local openml directory (#987)