Index: twisted/web/util.py
===================================================================
--- twisted/web/util.py	(revision 33398)
+++ twisted/web/util.py	(working copy)
@@ -14,6 +14,10 @@
 
 
 def redirectTo(URL, request):
+    # Patch for #5236
+    # If Unicode object is passed in URL, redirectTo raises TypeError
+    if isinstance(URL, unicode) :
+        raise TypeError("Unicode object not allowed as URL")
     request.setHeader("content-type", "text/html; charset=utf-8")
     request.redirect(URL)
     return """
Index: twisted/web/test/test_util.py
===================================================================
--- twisted/web/test/test_util.py	(revision 33398)
+++ twisted/web/test/test_util.py	(working copy)
@@ -73,4 +73,11 @@
             request.responseHeaders.getRawHeaders('content-type'),
             ['text/html; charset=utf-8'])
 
-
+    def test_redirectToUnicodeURL(self) :
+        """
+        L{redirectTo} will raise TypeError if unicode object is passed in URL
+        """  
+        request = Request(DummyChannel(), True)
+        request.method = 'GET'
+        targetURL = u'http://target.example.com/4321'
+        self.assertRaises(TypeError, redirectTo, targetURL, request) 
