Quellcode durchsuchen

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

Make Python 3 able to read settings files with Unicode characters
Adam Tauber vor 6 Jahren
Ursprung
Commit
8511e64f35
Es ist kein Account mit dieser Commiter-Email verbunden
3 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  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 Datei anzeigen

@@ -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 Datei anzeigen

@@ -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 Datei anzeigen

@@ -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