diff --git a/homeassistant/components/http.py b/homeassistant/components/http.py index 3ccf92daea2d81..0baa7dd177cb1b 100644 --- a/homeassistant/components/http.py +++ b/homeassistant/components/http.py @@ -437,7 +437,7 @@ def file(self, request, fil, mimetype=None): 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 66fb97dfd33392..60ff19d4a4322e 100644 --- a/tests/components/test_api.py +++ b/tests/components/test_api.py @@ -225,7 +225,7 @@ def test_api_get_components(self): 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()