From 95505797df503a086a311cab9aecbd2318522407 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 26 Nov 2019 14:29:03 +0000 Subject: Update to python3 --- lorrycontroller/status.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lorrycontroller/status.py') diff --git a/lorrycontroller/status.py b/lorrycontroller/status.py index 9d65c4e..2e6334d 100644 --- a/lorrycontroller/status.py +++ b/lorrycontroller/status.py @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2017 Codethink Limited +# Copyright (C) 2014-2019 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -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: + with open(temp_filename, 'wb') as f: f.write(html.encode("UTF-8")) os.rename(temp_filename, filename) @@ -85,7 +85,7 @@ class StatusRenderer(object): def temp_filename_in_same_dir_as(self, filename): dirname = os.path.dirname(filename) fd, temp_filename = tempfile.mkstemp(dir=dirname) - os.fchmod(fd, 0644) + os.fchmod(fd, 0o644) os.close(fd) return temp_filename -- cgit v1.2.1