Use CreateFileWithMode for cache.
authorScott Gasch <[email protected]>
Fri, 10 Mar 2023 20:36:55 +0000 (12:36 -0800)
committerScott Gasch <[email protected]>
Fri, 10 Mar 2023 20:36:55 +0000 (12:36 -0800)
examples/reminder/reminder.py

index 5fbd47639281ec97d087fd1cac1fdee298fadb13..f2ea267eaaa4ddc98387d56142a54bd2b6423f10 100755 (executable)
@@ -259,7 +259,9 @@ class Reminder(object):
     def save(self):
         import pickle
 
-        with open(config.config["reminder_cache_file"], "wb") as wf:
+        with file_utils.CreateFileWithMode(
+            config.config["reminder_cache_file"], filesystem_mode=0o600, open_mode="wb"
+        ) as wf:
             pickle.dump(
                 self.label_by_date,
                 wf,