diff --git a/readthedocs/config/config.py b/readthedocs/config/config.py index a0c13038866..a73f1be718a 100644 --- a/readthedocs/config/config.py +++ b/readthedocs/config/config.py @@ -1380,7 +1380,9 @@ def load(path, env_config, config_file=None): if config_file is None or config_file == '': filename = find_one(path, CONFIG_FILENAME_REGEX) else: - filename = "/".join([path, config_file]) + filename = os.path.join(path, config_file) + if not os.path.exists(filename): + raise ConfigError(f".readthedocs.yml not found at {config_file}", CONFIG_FILE_REQUIRED) if not filename: raise ConfigFileNotFound(path)