diff --git a/readthedocs/projects/tasks.py b/readthedocs/projects/tasks.py index 645523b3efb..6697cc25f30 100644 --- a/readthedocs/projects/tasks.py +++ b/readthedocs/projects/tasks.py @@ -157,7 +157,8 @@ def push_cached_environment(self): # Special handling for .cache directory because it's per-project path = os.path.join(project_path, '.cache') - tar.add(path, arcname='.cache') + if os.path.exists(path): + tar.add(path, arcname='.cache') storage = get_storage_class(settings.RTD_BUILD_ENVIRONMENT_STORAGE)() with open(tmp_filename, 'rb') as fd: