From 9b2f3929501e763ff1439d909009ccf4a1fc2f38 Mon Sep 17 00:00:00 2001 From: Lennart Purucker Date: Mon, 14 Oct 2024 17:24:25 +0200 Subject: [PATCH] add/fix: log messages for no premission --- openml/config.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openml/config.py b/openml/config.py index 928a152dc..d6841896e 100644 --- a/openml/config.py +++ b/openml/config.py @@ -251,7 +251,10 @@ def _setup(config: _Config | None = None) -> None: if not config_dir.exists(): config_dir.mkdir(exist_ok=True, parents=True) except PermissionError: - pass + openml_logger.warning( + f"No permission to create OpenML directory at {config_dir}!" + " This can result in OpenML-Python not working properly." + ) if config is None: config = _parse_config(config_file) @@ -275,8 +278,8 @@ def _setup(config: _Config | None = None) -> None: _create_log_handlers() except PermissionError: openml_logger.warning( - f"No permission to create OpenML directory at {config_dir}! This can result in " - " OpenML-Python not working properly." + f"No permission to create OpenML directory at {_root_cache_directory}!" + " This can result in OpenML-Python not working properly." ) _create_log_handlers(create_file_handler=False)