Browse Source

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

Make Python 3 able to read settings files with Unicode characters
Adam Tauber 6 years ago
parent
commit
8511e64f35
No account linked to committer's email
3 changed files with 3 additions and 3 deletions
  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 View File

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

+ 1
- 1
searx/engines/__init__.py View File

36
 
36
 
37
 categories = {'general': []}
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
 engine_shortcuts = {}
41
 engine_shortcuts = {}
42
 engine_default_args = {'paging': False,
42
 engine_default_args = {'paging': False,

+ 1
- 1
searx/engines/currency_convert.py View File

94
     global db
94
     global db
95
 
95
 
96
     current_dir = os.path.dirname(os.path.realpath(__file__))
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
     db = json.loads(json_data)
99
     db = json.loads(json_data)
100
 
100