misc: write files as binaries (#36515)

This commit is contained in:
Frédéric Péters 2019-11-12 11:07:26 +01:00
parent 1ea19f1c74
commit 48ffcf975a
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ def atomic_write(path, content, async_op=False):
fd, temp = tempfile.mkstemp(dir=dirname,
prefix='.tmp-'+os.path.basename(path)+'-')
os.fchmod(fd, 0o666 & ~process_umask)
f = os.fdopen(fd, "w")
f = os.fdopen(fd, "wb")
if hasattr(content, 'read'):
# file pointer
def read100k():