mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-22 18:22:21 +00:00
This commit is contained in:
parent
9a269547f2
commit
9cd5f54e31
1 changed files with 6 additions and 0 deletions
|
@ -1837,6 +1837,12 @@ def write_json_file(obj, fn):
|
||||||
os.unlink(fn)
|
os.unlink(fn)
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
mask = os.umask(0)
|
||||||
|
os.umask(mask)
|
||||||
|
os.chmod(tf.name, 0o666 & ~mask)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
os.rename(tf.name, fn)
|
os.rename(tf.name, fn)
|
||||||
except Exception:
|
except Exception:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue