summary refs log tree commit diff
path: root/synapse/config/_base.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-04-30 01:00:23 +0100
committerGitHub <noreply@github.com>2018-04-30 01:00:23 +0100
commit2fd96727b1a8b87a18d838bb95a838ff97d82fcc (patch)
tree8e9f973bca1d67b98d76aa31c4c582880553b7ae /synapse/config/_base.py
parentMerge pull request #3084 from NotAFile/py3-certs-byte-mode (diff)
parentopen log_config in text mode too (diff)
downloadsynapse-2fd96727b1a8b87a18d838bb95a838ff97d82fcc.tar.xz
Merge pull request #3085 from NotAFile/py3-config-text-mode
Open config file in non-bytes mode
Diffstat (limited to 'synapse/config/_base.py')
-rw-r--r--synapse/config/_base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/config/_base.py b/synapse/config/_base.py
index 32b439d20a..b748ed2b0a 100644
--- a/synapse/config/_base.py
+++ b/synapse/config/_base.py
@@ -281,15 +281,15 @@ class Config(object):
                     )
                 if not cls.path_exists(config_dir_path):
                     os.makedirs(config_dir_path)
-                with open(config_path, "wb") as config_file:
-                    config_bytes, config = obj.generate_config(
+                with open(config_path, "w") as config_file:
+                    config_str, config = obj.generate_config(
                         config_dir_path=config_dir_path,
                         server_name=server_name,
                         report_stats=(config_args.report_stats == "yes"),
                         is_generating_file=True
                     )
                     obj.invoke_all("generate_files", config)
-                    config_file.write(config_bytes)
+                    config_file.write(config_str)
                 print((
                     "A config file has been generated in %r for server name"
                     " %r with corresponding SSL keys and self-signed"