diff options
author | drebs <drebs@leap.se> | 2013-04-29 17:07:59 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-04-29 17:07:59 -0300 |
commit | a67c6796a56f4adbf8be225c23c9b3faaac95261 (patch) | |
tree | cb1982d0e2da43412d80e5a202985eb8bd1813a0 /src | |
parent | 8abc5d01b600a32c4612907894c7cc59ae10a1b2 (diff) |
Fix file left open in _store_symkey.
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/soledad/__init__.py | 5 |
1 files changed, 2 insertions, 3 deletions
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. |