diff --git a/redbot/core/data_manager.py b/redbot/core/data_manager.py index 06ceb7d79..6757fee27 100644 --- a/redbot/core/data_manager.py +++ b/redbot/core/data_manager.py @@ -44,6 +44,13 @@ if sys.platform == "linux": if not config_dir: config_dir = Path(appdir.user_config_dir) config_file = config_dir / "config.json" +if not config_file.exists() and sys.platform == "darwin": + # backwards compatibility with the location given by appdirs<1.4.4 + # which was the same as user_data_dir + # https://github.com/ActiveState/appdirs/issues/63 + _old_config_location = Path(appdir.user_data_dir) / "config.json" + if _old_config_location.exists(): + _old_config_location.rename(config_file) def create_temp_config(): diff --git a/redbot/setup.py b/redbot/setup.py index 15e1f8ecf..b8921d7da 100644 --- a/redbot/setup.py +++ b/redbot/setup.py @@ -32,6 +32,13 @@ except PermissionError: print("You don't have permission to write to '{}'\nExiting...".format(config_dir)) sys.exit(1) config_file = config_dir / "config.json" +if not config_file.exists() and sys.platform == "darwin": + # backwards compatibility with the location given by appdirs<1.4.4 + # which was the same as user_data_dir + # https://github.com/ActiveState/appdirs/issues/63 + _old_config_location = Path(appdir.user_data_dir) / "config.json" + if _old_config_location.exists(): + _old_config_location.rename(config_file) def load_existing_config():