aboutsummaryrefslogtreecommitdiffstats
path: root/generat3d
diff options
context:
space:
mode:
Diffstat (limited to 'generat3d')
-rw-r--r--generat3d/dbz.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/generat3d/dbz.py b/generat3d/dbz.py
index e5b1aea..ac244d5 100644
--- a/generat3d/dbz.py
+++ b/generat3d/dbz.py
@@ -78,6 +78,9 @@ def write(doc, out):
fd, tmp = tempfile.mkstemp(dir=out.parent, prefix=out.name, suffix=".tmp")
with os.fdopen(fd, "wb") as f:
f.write(gzip.compress(json.dumps(doc).encode()))
+ m = os.umask(0)
+ os.umask(m)
+ os.chmod(tmp, 0o666 & ~m) # mkstemp makes 0600
os.replace(tmp, out)
except BaseException as e:
if tmp is not None: