summary refs log tree commit diff
path: root/synapse/http/matrixfederationclient.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-09-17 16:15:42 +0100
committerRichard van der Hoff <richard@matrix.org>2018-09-17 16:15:42 +0100
commitf00a9d2636211e6762d8c8c627ebee3f6cea05c9 (patch)
tree6279dde60412ee79d88596173526c05914c20b1a /synapse/http/matrixfederationclient.py
parentREADME: run python_dependencies with -m (diff)
downloadsynapse-f00a9d2636211e6762d8c8c627ebee3f6cea05c9.tar.xz
Fix some b'abcd' noise in logs and metrics
Python 3 compatibility: make sure that we decode some byte sequences before we
use them to create log lines and metrics labels.
Diffstat (limited to 'synapse/http/matrixfederationclient.py')
-rw-r--r--synapse/http/matrixfederationclient.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index 13b19f7626..083484a687 100644
--- a/synapse/http/matrixfederationclient.py
+++ b/synapse/http/matrixfederationclient.py
@@ -244,7 +244,10 @@ class MatrixFederationHttpClient(object):
                             request_deferred,
                         )
 
-                    log_result = "%d %s" % (response.code, response.phrase,)
+                    log_result = "%d %s" % (
+                        response.code,
+                        response.phrase.decode('ascii', errors='replace'),
+                    )
                     break
                 except Exception as e:
                     if not retry_on_dns_fail and isinstance(e, DNSLookupError):