community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1867564 - /comdev/projects.apache.org/trunk/site/edit/save.py
Date Thu, 26 Sep 2019 08:14:36 GMT
Author: sebb
Date: Thu Sep 26 08:14:35 2019
New Revision: 1867564

URL: http://svn.apache.org/viewvc?rev=1867564&view=rev
Log:
Sync file write options with parseprojects

Modified:
    comdev/projects.apache.org/trunk/site/edit/save.py

Modified: comdev/projects.apache.org/trunk/site/edit/save.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/trunk/site/edit/save.py?rev=1867564&r1=1867563&r2=1867564&view=diff
==============================================================================
--- comdev/projects.apache.org/trunk/site/edit/save.py (original)
+++ comdev/projects.apache.org/trunk/site/edit/save.py Thu Sep 26 08:14:35 2019
@@ -24,16 +24,13 @@ try:
             js[k] = form[k].value
         with open("../json/projects/%s" % f, "w") as out:
             json.dump(js, out, sort_keys=True, indent=0)
-            out.close()
 
         with open("../json/foundation/projects.json", "r") as g:
             gjson = json.loads(g.read())
-            g.close()
 
             gjson[project] = js
-            with open("../json/foundation/projects.json", "w") as og:
-                json.dump(gjson, og, sort_keys=True, indent=0)
-                og.close()
+            with open("../json/foundation/projects.json", "w", encoding='utf-8') as og:
+                json.dump(gjson, og, sort_keys=True, indent=0, ensure_ascii=False)
 
 
         text = """



Mime
View raw message