[damned-lies] Refs #247 - Force utf-8 encoding when reading pot file



commit 687efa5e2c3c09b27d621f6fd14159c9cbec143e
Author: Claude Paroz <claude 2xlibre net>
Date:   Fri Jul 23 18:18:30 2021 +0200

    Refs #247 - Force utf-8 encoding when reading pot file

 stats/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/stats/utils.py b/stats/utils.py
index c2123c02..bbb16b29 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -759,7 +759,7 @@ def exclude_untrans_messages(potfile):
     if status != STATUS_OK:
         return
 
-    with open(str(potfile), 'r+') as fh:
+    with open(str(potfile), encoding='utf-8', mode='r+') as fh:
         lines = fh.readlines()
         fh.seek(0)
         skip_unit = False


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