Use tarfile.open as recommended by docs
@@ -124,7 +124,7 @@ class CachedEnvironmentMixin:
with open(tmp_filename, mode='wb') as local_fd:
local_fd.write(remote_fd.read())
- tar = tarfile.TarFile(tmp_filename)
+ with tarfile.open(tmp_filename) as tar:
tar.extractall(self.version.project.doc_path)
# Cleanup the temporary file
