diff options
author | Jürg Billeter <j@bitron.ch> | 2019-05-23 15:57:44 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-05-23 16:20:37 +0200 |
commit | b618670070027c892a84cd125dd028b708fb3c1b (patch) | |
tree | 92bc9d6b74647afa8e879492a73bffea60eac5d2 /src | |
parent | 156affd4a33562bd383b5fc598fb95b9f99da0ea (diff) | |
download | buildstream-b618670070027c892a84cd125dd028b708fb3c1b.tar.gz |
_artifact.py: Create artifact proto file atomically
Diffstat (limited to 'src')
-rw-r--r-- | src/buildstream/_artifact.py | 2 |
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 |