diff -r 724ac0a4068d -r 4cd9d0a9f42f VirtualMailManager/cli/config.py --- a/VirtualMailManager/cli/config.py Tue Nov 06 23:23:55 2012 +0000 +++ b/VirtualMailManager/cli/config.py Sun Nov 11 16:53:52 2012 +0000 @@ -89,8 +89,7 @@ def _save_changes(self): """Writes changes to the configuration file.""" copy2(self._cfg_filename, self._cfg_filename + '.bak') - self._cfg_file = open(self._cfg_filename, 'w') - self.write(self._cfg_file) - self._cfg_file.close() + with open(self._cfg_filename, 'w') as self._cfg_file: + self.write(self._cfg_file) del _