[sysadmin-bin] Re-use codec



commit fda76c9feb9a3c5f006c15b13b67297ae677dc00
Author: Andrea Veri <averi redhat com>
Date:   Thu Nov 12 22:38:09 2020 +0100

    Re-use codec

 membership/foundation-operations.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/membership/foundation-operations.py b/membership/foundation-operations.py
index ff98707..89faf0a 100755
--- a/membership/foundation-operations.py
+++ b/membership/foundation-operations.py
@@ -131,8 +131,10 @@ def generate_membership_list():
     memberslist = json.dumps(result, ensure_ascii=False)
 
     if len(memberslist) > 0:
-        with open('/srv/http/www.gnome.org/html/membership/memberslist', 'w') as membershipfile:
-            membershipfile.write(memberslist)
+        import codecs
+        membershipfile = codecs.open('/srv/http/www.gnome.org/html/membership/memberslist', 'w', 'utf8')
+        membershipfile.write(memberslist)
+        membershipfile.close()
 
 
 def send_form_letters(form_letter, email, name, *args):


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