Skip to content
Snippets Groups Projects
Unverified Commit 77df0e5b authored by Christophe Monniez's avatar Christophe Monniez
Browse files

[FIX] misc: Force utf-8 decoding when opening a file

parent 0bab2e7f
No related branches found
No related tags found
No related merge requests found
......@@ -215,7 +215,10 @@ def _fileopen(path, mode, basedir, pathinfo, basename=None):
# Give higher priority to module directories, which is
# a more common case than zipped modules.
if os.path.isfile(name):
fo = open(name, mode)
if 'b' in mode:
fo = open(name, mode)
else:
fo = io.open(name, mode, encoding='utf-8')
if pathinfo:
return fo, name
return fo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment