community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1867029 - /comdev/projects.apache.org/trunk/scripts/cronjobs/parsecommitteeinfo.py
Date Mon, 16 Sep 2019 22:20:29 GMT
Author: sebb
Date: Mon Sep 16 22:20:29 2019
New Revision: 1867029

URL: http://svn.apache.org/viewvc?rev=1867029&view=rev
Log:
Shut files after use

Modified:
    comdev/projects.apache.org/trunk/scripts/cronjobs/parsecommitteeinfo.py

Modified: comdev/projects.apache.org/trunk/scripts/cronjobs/parsecommitteeinfo.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/trunk/scripts/cronjobs/parsecommitteeinfo.py?rev=1867029&r1=1867028&r2=1867029&view=diff
==============================================================================
--- comdev/projects.apache.org/trunk/scripts/cronjobs/parsecommitteeinfo.py (original)
+++ comdev/projects.apache.org/trunk/scripts/cronjobs/parsecommitteeinfo.py Mon Sep 16 22:20:29
2019
@@ -96,7 +96,8 @@ for loc in xmldoc.getElementsByTagName('
         if url.startswith('http'):
             rdf = urllib.request.urlopen(url).read()
         else:
-            rdf = open("../../data/%s" % url, 'r', encoding='utf-8').read()
+            with open("../../data/%s" % url, 'r', encoding='utf-8') as f:
+                rdf = f.read()
             url = "https://svn.apache.org/repos/asf/comdev/projects.apache.org/trunk/data/%s"
% url
         rdfxml = ET.fromstring(rdf)
         rdfdata = rdfxml[0]



Mime
View raw message