# HG changeset patch # User Rémi Cardona # Date 1448464962 -3600 # Node ID 6168a45f62df61d670286d6181b1b58134b11369 # Parent e0f5bfafec902a81673c130bbb22c7bc9159a8ce [cwconfig] Explicitly close generated config file diff -r e0f5bfafec90 -r 6168a45f62df cwconfig.py --- a/cwconfig.py Wed Nov 25 17:57:07 2015 +0100 +++ b/cwconfig.py Wed Nov 25 16:22:42 2015 +0100 @@ -1059,7 +1059,8 @@ def save(self): """write down current configuration""" - self.generate_config(open(self.main_config_file(), 'w')) + with open(self.main_config_file(), 'w') as fobj: + self.generate_config(fobj) def check_writeable_uid_directory(self, path): """check given directory path exists, belongs to the user running the