浏览代码

Merge pull request #1124 from JosephKiranBabu/python3-unicode-support

Make Python 3 able to read settings files with Unicode characters
Adam Tauber 6 年前
父节点
当前提交
8511e64f35
没有帐户链接到提交者的电子邮件
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 1
    1
      searx/__init__.py
  2. 1
    1
      searx/engines/__init__.py
  3. 1
    1
      searx/engines/currency_convert.py

+ 1
- 1
searx/__init__.py 查看文件

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

+ 1
- 1
searx/engines/__init__.py 查看文件

@@ -36,7 +36,7 @@ engines = {}
36 36
 
37 37
 categories = {'general': []}
38 38
 
39
-languages = loads(open(engine_dir + '/../data/engines_languages.json').read())
39
+languages = loads(open(engine_dir + '/../data/engines_languages.json', 'rb').read())
40 40
 
41 41
 engine_shortcuts = {}
42 42
 engine_default_args = {'paging': False,

+ 1
- 1
searx/engines/currency_convert.py 查看文件

@@ -94,7 +94,7 @@ def load():
94 94
     global db
95 95
 
96 96
     current_dir = os.path.dirname(os.path.realpath(__file__))
97
-    json_data = open(current_dir + "/../data/currencies.json").read()
97
+    json_data = open(current_dir + "/../data/currencies.json", 'rb').read()
98 98
 
99 99
     db = json.loads(json_data)
100 100