Browse Source

[utils] Fix file permissions in write_json_file (closes #12471) (#25122)

master
Rob 5 years ago
committed by GitHub
parent
commit
9cd5f54e31
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      youtube_dl/utils.py

+ 6
- 0
youtube_dl/utils.py View File

@ -1837,6 +1837,12 @@ def write_json_file(obj, fn):
os.unlink(fn)
except OSError:
pass
try:
mask = os.umask(0)
os.umask(mask)
os.chmod(tf.name, 0o666 & ~mask)
except OSError:
pass
os.rename(tf.name, fn)
except Exception:
try:


Loading…
Cancel
Save