From 0fb301784891b5d8832697886f06af35cdd59236 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= <sybren@stuvel.eu>
Date: Tue, 9 May 2017 10:24:48 +0200
Subject: [PATCH] Fixed bug in merge_with_home_config()

---
 CHANGELOG.md              | 5 +++++
 flamenco_worker/config.py | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 279659f4..45fa0a7b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/flamenco_worker/config.py b/flamenco_worker/config.py
index 5a0e4d22..2e9ac2b3 100644
--- a/flamenco_worker/config.py
+++ b/flamenco_worker/config.py
@@ -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)
-- 
GitLab