projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a26954
)
[utils] Fix file permissions in write_json_file (closes #12471) (#25122)
author
Rob
<ankenyr@gmail.com>
Tue, 19 May 2020 20:21:52 +0000
(13:21 -0700)
committer
GitHub
<noreply@github.com>
Tue, 19 May 2020 20:21:52 +0000
(
03:21
+0700)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 112279ed7dfc484395d0d8b57b81c03a7a14e9ec..d1eca3760a66e89fbfc1673e70a2d526035776cf 100644
(file)
--- 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: