From bdc803e185e1a7bb14892405a2c0c840ba6e0fe1 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Tue, 19 Dec 2017 13:04:18 +0530 Subject: Make Python 3 able to read settings files with Unicode characters SearX currently doesn't start up when run with Python 3 as it tries to parse the settings.yml file with ASCII codecs. There are similar problems with engines_languages.json and currencies.json Python 3 requires that files with Unicode characters be read with a 'b' flag. This also works with Python 2 and hence can be integrated into the main source code. Tested with the latest Python 3.6.4rc1 on Debian unstable. Signed-off-by: Joseph Nuthalapati --- searx/engines/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'searx/engines/__init__.py') diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index 7a9cc56a2..bec8de3a8 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -36,7 +36,7 @@ engines = {} categories = {'general': []} -languages = loads(open(engine_dir + '/../data/engines_languages.json').read()) +languages = loads(open(engine_dir + '/../data/engines_languages.json', 'rb').read()) engine_shortcuts = {} engine_default_args = {'paging': False, -- cgit v1.2.3