From a564fe828669ed11c964668a9e72958a1f07bb24 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 21 Jun 2016 22:26:40 -0700 Subject: [PATCH] Fix error log (#2349) --- homeassistant/components/http.py | 2 +- tests/components/test_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/http.py b/homeassistant/components/http.py index 3ccf92daea2..0baa7dd177c 100644 --- a/homeassistant/components/http.py +++ b/homeassistant/components/http.py @@ -437,7 +437,7 @@ class HomeAssistantView(object): mimetype = mimetypes.guess_type(fil)[0] try: - fil = open(fil) + fil = open(fil, mode='br') except IOError: raise NotFound() diff --git a/tests/components/test_api.py b/tests/components/test_api.py index 66fb97dfd33..60ff19d4a43 100644 --- a/tests/components/test_api.py +++ b/tests/components/test_api.py @@ -225,7 +225,7 @@ class TestAPI(unittest.TestCase): def test_api_get_error_log(self): """Test the return of the error log.""" - test_content = 'Test String' + test_content = 'Test String°' with tempfile.NamedTemporaryFile() as log: log.write(test_content.encode('utf-8')) log.flush()