[kupfer] utils: Use mode 0666 in get_destfile_in_directory
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] utils: Use mode 0666 in get_destfile_in_directory
- Date: Mon, 7 Sep 2009 21:50:07 +0000 (UTC)
commit 34691a40ad047d1f06522a033b893e5175ca5494
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Mon Sep 7 21:12:55 2009 +0200
utils: Use mode 0666 in get_destfile_in_directory
For os.open, we have to override the default mode of 0777. The mode
passed in is combined with the umask. This way we won't make
downloaded files executable, which is wrong for many reasons.
kupfer/utils.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/utils.py b/kupfer/utils.py
index 02de06b..67e5c02 100644
--- a/kupfer/utils.py
+++ b/kupfer/utils.py
@@ -159,7 +159,7 @@ def get_destfile_in_directory(directory, filename, extension=None):
for retry in xrange(3):
destpath = get_destpath_in_directory(directory, filename, extension)
try:
- fd = os.open(destpath, os.O_CREAT | os.O_EXCL | os.O_WRONLY)
+ fd = os.open(destpath, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0666)
except OSError, exc:
pretty.print_error(__name__, exc)
else:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]