changeset 1006:509ea9995c9d

use config.umask for saved drawing files (backport to 1.5)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 22 Jul 2006 14:45:58 +0200
parents e1e1885deec1
children 8cc609b746de
files MoinMoin/action/AttachFile.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sat Jul 22 14:29:34 2006 +0200
+++ b/MoinMoin/action/AttachFile.py	Sat Jul 22 14:45:58 2006 +0200
@@ -620,11 +620,12 @@
         # delete map file if it is empty
         os.unlink(savepath)
     else:
-        file = open(savepath, 'wb')
+        stream = open(savepath, 'wb')
         try:
-            file.write(filecontent)
+            stream.write(filecontent)
         finally:
-            file.close()
+            stream.close()
+        os.chmod(savepath, 0666 & config.umask)
 
     # touch attachment directory to invalidate cache if new map is saved
     if ext == '.map':