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 <njoseph@thoughtworks.com>
This commit is contained in:
Joseph Nuthalapati 2017-12-19 13:04:18 +05:30
parent 943404a103
commit bdc803e185
No known key found for this signature in database
GPG key ID: 5398F00A2FA43C35
3 changed files with 3 additions and 3 deletions

View file

@ -50,7 +50,7 @@ if not settings_path:
raise Exception('settings.yml not found')
# load settings
with open(settings_path) as settings_yaml:
with open(settings_path, 'rb') as settings_yaml:
settings = load(settings_yaml)
'''