From 058993485b6e10bbc07144252f2f4db9dd667b75 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 29 Apr 2013 17:05:35 -0300 Subject: Fix file left open in _has_symkey(). --- src/leap/soledad/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/leap/soledad') diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py index fe85bab9..96b05628 100644 --- a/src/leap/soledad/__init__.py +++ b/src/leap/soledad/__init__.py @@ -307,8 +307,8 @@ class Soledad(object): if not os.path.isfile(self._config.get_secret_path()): return False # is it symmetrically encrypted? - f = open(self._config.get_secret_path(), 'r') - content = f.read() + with open(self._config.get_secret_path(), 'r') as f: + content = f.read() if not self._crypto.is_encrypted_sym(content): raise DocumentNotEncrypted( "File %s is not encrypted!" % self._config.get_secret_path()) -- cgit v1.2.3