summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorAdrian Tschira <nota@notafile.com>2018-04-07 01:39:45 +0200
committerAdrian Tschira <nota@notafile.com>2018-04-10 17:32:40 +0200
commit7f8eebc8ee801467b0a04aa0fb07b1ba58866f22 (patch)
tree412121fe1ef66cf203b5fce3badf51eeacc130e1 /synapse/config
parentMerge branch 'release-v0.27.0' of https://github.com/matrix-org/synapse into ... (diff)
downloadsynapse-7f8eebc8ee801467b0a04aa0fb07b1ba58866f22.tar.xz
Open config file in non-bytes mode
Nothing written into it is encoded, so it makes little sense, but it
does break in python3 the way it was before.

The variable names were adjusted to be less misleading.

Signed-off-by: Adrian Tschira <nota@notafile.com>
Diffstat (limited to 'synapse/config')
-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"