From ad0c781c37ccac7bb3c6b7947296c6f3409336e2 Mon Sep 17 00:00:00 2001 From: gibbed Date: Sat, 22 Feb 2020 12:06:15 -0600 Subject: [PATCH] Fix diff.py to assume UTF-8. --- tools/diff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/diff.py b/tools/diff.py index 29bc1ff33..1ec660e68 100644 --- a/tools/diff.py +++ b/tools/diff.py @@ -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))