From fc7c15f882d800cc7bce03936dfec7c5b7cd13bf Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Tue, 9 Jun 2020 11:47:42 +0530 Subject: [PATCH] save_to_file: fix fd open mode since we used O_WRONLY with os.open(), lets stick to same mode with os.fdopen() too Signed-off-by: Prasanna Kumar Kalever --- rtslib/root.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtslib/root.py b/rtslib/root.py index 3135467..2c5cf43 100644 --- a/rtslib/root.py +++ b/rtslib/root.py @@ -479,7 +479,7 @@ def save_to_file(self, save_file=None, so_path=None): finally: os.umask(umask_original) - with os.fdopen(fdesc, 'w+') as f: + with os.fdopen(fdesc, 'w') as f: f.write(json.dumps(saveconf, sort_keys=True, indent=2)) f.write("\n") f.flush()