mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 02:22:22 +02:00
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:
parent
943404a103
commit
bdc803e185
3 changed files with 3 additions and 3 deletions
|
@ -94,7 +94,7 @@ def load():
|
|||
global db
|
||||
|
||||
current_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
json_data = open(current_dir + "/../data/currencies.json").read()
|
||||
json_data = open(current_dir + "/../data/currencies.json", 'rb').read()
|
||||
|
||||
db = json.loads(json_data)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue