diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index 20ab9e269cefc435734e509f66364c6be4d09fed..11d20a5d2dd8c4472fdd68b4d31cd283278e3eb0 100644
--- a/synapse/handlers/directory.py
+++ b/synapse/handlers/directory.py
@@ -160,7 +160,7 @@ class DirectoryHandler(BaseHandler):
         if not room_id:
             raise SynapseError(
                 404,
-                "Room alias %r not found" % (room_alias.to_string(),),
+                "Room alias %s not found" % (room_alias.to_string(),),
                 Codes.NOT_FOUND
             )