From cd3f28d8a731475158bb97b807cb451929307cd0 Mon Sep 17 00:00:00 2001 From: Eric Rasche Date: Tue, 10 May 2016 15:24:07 +0000 Subject: [PATCH] Unicodify has different semantics to str Originally my patch was written with str()'s behaviour in mind. If a value is None, it gets cast. I did not test my patch well enough following @nsoranzo's request to replace with unicodify(). In that case a raw None gets passed to cgi.escape() causing a bug --- lib/galaxy/tools/errors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/tools/errors.py b/lib/galaxy/tools/errors.py index d29eb56054e..18ca67700a2 100644 --- a/lib/galaxy/tools/errors.py +++ b/lib/galaxy/tools/errors.py @@ -209,7 +209,8 @@ class ErrorReporter( object ): # Escape all of the content for use in the HTML report for parameter in report_variables.keys(): - report_variables[parameter] = cgi.escape(unicodify(report_variables[parameter])) + if report_variables[parameter] is not None: + report_variables[parameter] = cgi.escape(unicodify(report_variables[parameter])) self.html_report = string.Template( error_report_template_html ).safe_substitute( report_variables )