X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/b9a5031529f8a67d511988b11f489860413fad26..9988a0c7b237b58c40b7fe12d1ffcd1a9b0e5741:/youtube_dl/utils.py diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 112279e..d1eca37 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -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: