[web/application] return bytes from redirect_handler and validation_error_handler
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 03 Nov 2015 12:25:14 +0100
changeset 10820 fef0ab4c4f94
parent 10819 5b5864483c4d
child 10821 107b87bbbaa7
[web/application] return bytes from redirect_handler and validation_error_handler
web/application.py
--- a/web/application.py	Mon Oct 19 17:54:26 2015 +0200
+++ b/web/application.py	Tue Nov 03 12:25:14 2015 +0100
@@ -439,7 +439,7 @@
         req.headers_out.setHeader('location', str(ex.location))
         assert 300 <= ex.status < 400
         req.status_out = ex.status
-        return ''
+        return b''
 
     def validation_error_handler(self, req, ex):
         ex.translate(req._) # translate messages using ui language
@@ -456,7 +456,7 @@
             location = req.form['__errorurl'].rsplit('#', 1)[0]
             req.headers_out.setHeader('location', str(location))
             req.status_out = http_client.SEE_OTHER
-            return ''
+            return b''
         req.status_out = http_client.CONFLICT
         return self.error_handler(req, ex, tb=False)