X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Futils.py;h=d1eca3760a66e89fbfc1673e70a2d526035776cf;hb=84213ea8d41d5fe1608333a16ac578dccdf9a915;hp=112279ed7dfc484395d0d8b57b81c03a7a14e9ec;hpb=c380cc28c4e94b4b61db7f86d35e48197b407266;p=youtube-dl diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 112279ed7..d1eca3760 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: