From 829032f306cec8f6d109bfb037a01dc50ff87442 Mon Sep 17 00:00:00 2001 From: Marc Abonce Seguin Date: Tue, 16 Jan 2018 23:05:18 -0600 Subject: [fix] read utf-8 files (settings, languages, currency) with python3.5 Related to discussion in #1124 The io.open import is necessary for python2 --- searx/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'searx/__init__.py') diff --git a/searx/__init__.py b/searx/__init__.py index d277570bb..b1010f25f 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -19,6 +19,7 @@ import certifi import logging from os import environ from os.path import realpath, dirname, join, abspath, isfile +from io import open from ssl import OPENSSL_VERSION_INFO, OPENSSL_VERSION try: from yaml import load @@ -50,7 +51,7 @@ if not settings_path: raise Exception('settings.yml not found') # load settings -with open(settings_path, 'rb') as settings_yaml: +with open(settings_path, 'r', encoding='utf-8') as settings_yaml: settings = load(settings_yaml) ''' -- cgit v1.2.3