Fix diff.py to assume UTF-8.

This commit is contained in:
gibbed 2020-02-22 12:06:15 -06:00 committed by Rick Gibbed
parent 6c81f32426
commit ad0c781c37
1 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import difflib
import sys
diff = difflib.unified_diff(
open(sys.argv[1]).readlines(),
open(sys.argv[2]).readlines())
with open(sys.argv[3], 'w') as f:
open(sys.argv[1], encoding='utf-8').readlines(),
open(sys.argv[2], encoding='utf-8').readlines())
with open(sys.argv[3], 'w', encoding='utf-8') as f:
f.write(''.join(diff))