From a67c6796a56f4adbf8be225c23c9b3faaac95261 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 29 Apr 2013 17:07:59 -0300 Subject: Fix file left open in _store_symkey. --- src/leap/soledad/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/leap/soledad') diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py index 5b2f5fc1..3b7aadea 100644 --- a/src/leap/soledad/__init__.py +++ b/src/leap/soledad/__init__.py @@ -356,9 +356,8 @@ class Soledad(object): def _store_symkey(self): ciphertext = self._crypto.encrypt_sym( self._symkey, self._passphrase) - f = open(self._config.get_secret_path(), 'w') - f.write(str(ciphertext)) - f.close() + with open(self._config.get_secret_path(), 'w') as f: + f.write(ciphertext) #------------------------------------------------------------------------- # General crypto utility methods. -- cgit v1.2.3