From 170b2ce981f6e7be834be56bee3c81da503555ee Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Piedehierro Date: Sun, 9 Jul 2017 00:59:03 +0100 Subject: status: Encode generated html as UTF-8 Some job outputs include Unicode characters. This made the status.html generation fail given that some job logs are included in the status page. --- lorrycontroller/status.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lorrycontroller/status.py b/lorrycontroller/status.py index 58669fb..9c907bf 100644 --- a/lorrycontroller/status.py +++ b/lorrycontroller/status.py @@ -61,7 +61,7 @@ class StatusRenderer(object): try: temp_filename = self.temp_filename_in_same_dir_as(filename) with open(temp_filename, 'w') as f: - f.write(html) + f.write(html.encode("UTF-8")) os.rename(temp_filename, filename) except (OSError, IOError) as e: self.remove_temp_file(temp_filename) -- cgit v1.2.1