[damned-lies] Force reading files in utf-8 in potdiff



commit 4bc83de7feba8f0a6524f9690fcbf7718664d4e0
Author: Claude Paroz <claude 2xlibre net>
Date:   Tue Feb 28 21:28:41 2017 +0100

    Force reading files in utf-8 in potdiff

 stats/potdiff.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/stats/potdiff.py b/stats/potdiff.py
index e8c2480..613f8a8 100644
--- a/stats/potdiff.py
+++ b/stats/potdiff.py
@@ -6,12 +6,12 @@ USE_DIFFLIB = 0
 
 def diff(pota, potb):
     """Returns a list of differing lines between two text files."""
-    with open(pota, "r") as f1:
+    with open(pota, "r", encoding="utf-8") as f1:
         data1 = f1.read()
     res1 = _parse_contents(data1)
     res1.sort()
 
-    with open(potb, "r") as f2:
+    with open(potb, "r", encoding="utf-8") as f2:
         data2 = f2.read()
     res2 = _parse_contents(data2)
     res2.sort()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]