We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b5bb99c + 657cbfc commit 24ca737Copy full SHA for 24ca737
readthedocs/projects/tasks.py
@@ -119,17 +119,9 @@ def pull_cached_environment(self):
119
'msg': msg,
120
}
121
)
122
- _, tmp_filename = tempfile.mkstemp(suffix='.tar')
123
remote_fd = storage.open(filename, mode='rb')
124
- with open(tmp_filename, mode='wb') as local_fd:
125
- local_fd.write(remote_fd.read())
126
-
127
- with tarfile.open(tmp_filename) as tar:
128
- tar.extractall(self.version.project.doc_path)
129
130
- # Cleanup the temporary file
131
- if os.path.exists(tmp_filename):
132
- os.remove(tmp_filename)
+ with tarfile.open(fileobj=remote_fd) as tar:
+ tar.extractall(self.project.doc_path)
133
134
def push_cached_environment(self):
135
if not self.project.has_feature(feature_id=Feature.CACHED_ENVIRONMENT):
0 commit comments