diff --git a/CHANGELOG.md b/CHANGELOG.md
index 279659f4829bef2b0417dcaea52ba15863300666..45fa0a7bd68c71a7a2290bd8b5379cbbff245992 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 5a0e4d22548d87f6d45b306174b2f4e4b9e8de15..2e9ac2b37e51bccdecce7f8c31b2d23942a5f2e8 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)