[imp] module,http: open manifest files as utf-8 in a python2/3 compatible way
This commit is contained in:
+2
-1
@@ -1311,7 +1311,8 @@ class Root(object):
|
||||
manifest_path = module_manifest(mod_path)
|
||||
path_static = opj(addons_path, module, 'static')
|
||||
if manifest_path and os.path.isdir(path_static):
|
||||
manifest = ast.literal_eval(open(manifest_path).read())
|
||||
manifest_data = open(manifest_path, 'rb').read()
|
||||
manifest = ast.literal_eval(pycompat.to_native(manifest_data))
|
||||
if not manifest.get('installable', True):
|
||||
continue
|
||||
manifest['addons_path'] = addons_path
|
||||
|
||||
@@ -328,9 +328,9 @@ def load_information_from_description_file(module, mod_path=None):
|
||||
'depends data demo test init_xml update_xml demo_xml'.split(),
|
||||
iter(list, None)))
|
||||
|
||||
f = tools.file_open(manifest_file)
|
||||
f = tools.file_open(manifest_file, mode='rb')
|
||||
try:
|
||||
info.update(ast.literal_eval(f.read()))
|
||||
info.update(ast.literal_eval(pycompat.to_native(f.read())))
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user