py/makedefs: Use io.open with utf-8 encoding when processing source.
In case (user) source code contains utf-8 encoded data and the default locale is not utf-8. See #4592.
This commit is contained in:
@@ -9,6 +9,7 @@ from __future__ import print_function
|
||||
|
||||
import re
|
||||
import sys
|
||||
import io
|
||||
import os
|
||||
|
||||
# Blacklist of qstrings that are specially handled in further
|
||||
@@ -108,7 +109,7 @@ if __name__ == "__main__":
|
||||
pass
|
||||
|
||||
if args.command == "split":
|
||||
with open(args.input_filename) as infile:
|
||||
with io.open(args.input_filename, encoding='utf-8') as infile:
|
||||
process_file(infile)
|
||||
|
||||
if args.command == "cat":
|
||||
|
||||
Reference in New Issue
Block a user