Skip to content
Snippets Groups Projects
Commit 0fb30178 authored by Sybren A. Stüvel's avatar Sybren A. Stüvel
Browse files

Fixed bug in merge_with_home_config()

parent 1fb33788
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,11 @@
This file logs the changes that are actually interesting to users (new features,
changed functionality, fixed bugs).
## Version 2.0.4 (in development)
- Fixed bug in writing ~/.flamenco-worker.cfg
## Version 2.0.3 (released 2017-04-07)
- Made the `flamenco-worker.cfg` file mandatory, as this makes debugging configuration
......
......@@ -51,14 +51,14 @@ def merge_with_home_config(new_conf: dict):
confparser = ConfigParser()
confparser.read_dict({CONFIG_SECTION: {}})
confparser.read(HOME_CONFIG_FILE, encoding='utf8')
confparser.read(str(HOME_CONFIG_FILE), encoding='utf8')
for key, value in new_conf.items():
confparser.set(CONFIG_SECTION, key, value)
tmpname = HOME_CONFIG_FILE.with_name(HOME_CONFIG_FILE.name + '~')
log.debug('Writing configuration file to %s', tmpname)
with open(tmpname, mode='wt', encoding='utf8') as outfile:
with tmpname.open(mode='wt', encoding='utf8') as outfile:
confparser.write(outfile)
log.debug('Moving configuration file to %s', HOME_CONFIG_FILE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment