mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 02:22:22 +02:00
[fix] read utf-8 files (settings, languages, currency) with python3.5
Related to discussion in #1124 The io.open import is necessary for python2
This commit is contained in:
parent
5947c05649
commit
829032f306
3 changed files with 6 additions and 3 deletions
|
@ -4,6 +4,7 @@ import os
|
|||
import sys
|
||||
import unicodedata
|
||||
|
||||
from io import open
|
||||
from datetime import datetime
|
||||
|
||||
if sys.version_info[0] == 3:
|
||||
|
@ -94,7 +95,7 @@ def load():
|
|||
global db
|
||||
|
||||
current_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
json_data = open(current_dir + "/../data/currencies.json", 'rb').read()
|
||||
json_data = open(current_dir + "/../data/currencies.json", 'r', encoding='utf-8').read()
|
||||
|
||||
db = json.loads(json_data)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue