
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com> V1 -> V2 improve commit message. ShaoHe Feng (1): Issue #333: do not encode error.html when the cherrpy version less than '3.2.5' src/kimchi/root.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 1.8.4.2

From: ShaoHe Feng <shaohef@linux.vnet.ibm.com> cherrypy does not encode the return of get_error_page from changeset 3591:35064e17ea5d. The 3591:35064e17ea5d is lower than 3.2.5 version (changeset 3677:052f32b1d563). And it is higher than 3.2.4 version (changeset 3497:cd8acbc5f2b3). issue: https://github.com/kimchi-project/kimchi/issues/333 Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- src/kimchi/root.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kimchi/root.py b/src/kimchi/root.py index 3956ea6..5bad9b4 100644 --- a/src/kimchi/root.py +++ b/src/kimchi/root.py @@ -22,6 +22,7 @@ import json import os +from distutils.version import LooseVersion from kimchi import auth from kimchi import template from kimchi.i18n import messages @@ -49,7 +50,8 @@ class Root(Resource): def error_production_handler(self, status, message, traceback, version): data = {'code': status, 'reason': message} res = template.render('error.html', data) - if type(res) is unicode: + if (type(res) is unicode and + LooseVersion(cherrypy.__version__) < LooseVersion('3.2.5')): res = res.encode("utf-8") return res @@ -57,7 +59,8 @@ class Root(Resource): data = {'code': status, 'reason': message, 'call_stack': cherrypy._cperror.format_exc()} res = template.render('error.html', data) - if type(res) is unicode: + if (type(res) is unicode and + LooseVersion(cherrypy.__version__) < LooseVersion('3.2.5')): res = res.encode("utf-8") return res -- 1.8.4.2

Reviewed-by: Daniel Barboza <danielhb@linux.vnet.ibm.com> On 03/03/2014 07:43 AM, shaohef@linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
cherrypy does not encode the return of get_error_page from changeset 3591:35064e17ea5d.
The 3591:35064e17ea5d is lower than 3.2.5 version (changeset 3677:052f32b1d563). And it is higher than 3.2.4 version (changeset 3497:cd8acbc5f2b3).
issue: https://github.com/kimchi-project/kimchi/issues/333
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> --- src/kimchi/root.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/root.py b/src/kimchi/root.py index 3956ea6..5bad9b4 100644 --- a/src/kimchi/root.py +++ b/src/kimchi/root.py @@ -22,6 +22,7 @@ import json import os
+from distutils.version import LooseVersion from kimchi import auth from kimchi import template from kimchi.i18n import messages @@ -49,7 +50,8 @@ class Root(Resource): def error_production_handler(self, status, message, traceback, version): data = {'code': status, 'reason': message} res = template.render('error.html', data) - if type(res) is unicode: + if (type(res) is unicode and + LooseVersion(cherrypy.__version__) < LooseVersion('3.2.5')): res = res.encode("utf-8") return res
@@ -57,7 +59,8 @@ class Root(Resource): data = {'code': status, 'reason': message, 'call_stack': cherrypy._cperror.format_exc()} res = template.render('error.html', data) - if type(res) is unicode: + if (type(res) is unicode and + LooseVersion(cherrypy.__version__) < LooseVersion('3.2.5')): res = res.encode("utf-8") return res

Applied. Thanks. Regards, Aline Manera
participants (4)
-
Aline Manera
-
Daniel H Barboza
-
Ramon Medeiros
-
shaohef@linux.vnet.ibm.com