summaryrefslogtreecommitdiff
path: root/lorrycontroller/status.py
diff options
context:
space:
mode:
Diffstat (limited to 'lorrycontroller/status.py')
-rw-r--r--lorrycontroller/status.py6
1 files changed, 3 insertions, 3 deletions
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