summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/buildstream/_artifact.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buildstream/_artifact.py b/src/buildstream/_artifact.py
index b3ef005f0..90d25b4fe 100644
--- a/src/buildstream/_artifact.py
+++ b/src/buildstream/_artifact.py
@@ -183,7 +183,7 @@ class Artifact():
keys = utils._deduplicate([self._cache_key, self._weak_cache_key])
for key in keys:
path = os.path.join(self._artifactdir, element.get_artifact_name(key=key))
- with open(path, mode='w+b') as f:
+ with utils.save_file_atomic(path, mode='wb') as f:
f.write(artifact.SerializeToString())
return size