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
This commit is contained in:
Eric Rasche
2016-05-10 15:24:07 +00:00
parent 74e6d8b5d8
commit cd3f28d8a7
+2 -1
View File
@@ -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 )