# HG changeset patch # User Pascal Volk # Date 1354463477 0 # Node ID ad967c4b7fe5efca3395b135537a3e44e8a0b016 # Parent 6515e3b88dec7334bd95267eeb259992c817e472 VMM{/cli}/config: Explicitly pass utf-8 as the encoding to open(). diff -r 6515e3b88dec -r ad967c4b7fe5 VirtualMailManager/cli/config.py --- a/VirtualMailManager/cli/config.py Sun Dec 02 14:54:24 2012 +0000 +++ b/VirtualMailManager/cli/config.py Sun Dec 02 15:51:17 2012 +0000 @@ -89,7 +89,7 @@ def _save_changes(self): """Writes changes to the configuration file.""" copy2(self._cfg_filename, self._cfg_filename + '.bak') - with open(self._cfg_filename, 'w') as self._cfg_file: + with open(self._cfg_filename, 'w', encoding='utf-8') as self._cfg_file: self.write(self._cfg_file) del _ diff -r 6515e3b88dec -r ad967c4b7fe5 VirtualMailManager/config.py --- a/VirtualMailManager/config.py Sun Dec 02 14:54:24 2012 +0000 +++ b/VirtualMailManager/config.py Sun Dec 02 15:51:17 2012 +0000 @@ -358,7 +358,7 @@ Raises a ConfigError if the configuration syntax is invalid. """ - with open(self._cfg_filename, 'r') as self._cfg_file: + with open(self._cfg_filename, 'r', encoding='utf-8') as self._cfg_file: try: self.readfp(self._cfg_file) except (MissingSectionHeaderError, ParsingError) as err: