summaryrefslogtreecommitdiff
path: root/lorrycontroller/status.py
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2019-11-26 14:29:03 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2019-11-27 15:06:12 +0000
commit95505797df503a086a311cab9aecbd2318522407 (patch)
tree1e3cf32a50ac10e9c95d59db883069051683f49e /lorrycontroller/status.py
parent2d54f8036d1f58df9690849f5b82134927561d1e (diff)
downloadlorry-controller-95505797df503a086a311cab9aecbd2318522407.tar.gz
Update to python3
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