community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1878443 - /comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py
Date Wed, 03 Jun 2020 15:57:10 GMT
Author: sebb
Date: Wed Jun  3 15:57:10 2020
New Revision: 1878443

URL: http://svn.apache.org/viewvc?rev=1878443&view=rev
Log:
Use urlutils for http access

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

Modified: comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py?rev=1878443&r1=1878442&r2=1878443&view=diff
==============================================================================
--- comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py (original)
+++ comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py Wed Jun  3 15:57:10
2020
@@ -22,7 +22,8 @@ if sys.hexversion < 0x03000000:
     raise ImportError("This script requires Python 3")
 from xml.dom import minidom
 import xml.etree.ElementTree as ET
-import re, urllib.request
+import re
+from urlutils import URLopen
 import urllib.error
 import json
 import os
@@ -120,7 +121,7 @@ def name2fileName(s, pmc):
 # Process external PMC descriptor file to extract the PMC name
 def getPMC(url):
     print("Parsing PMC descriptor file %s" % url)
-    rdf = urllib.request.urlopen(url, timeout=URL_TIMEOUT).read()
+    rdf = URLopen(url).read()
     md = minidom.parseString(rdf)
     pmc = (md.getElementsByTagName('asfext:pmc') or md.getElementsByTagName('asfext:PMC'))[0]
     t = pmc.tagName.lower()
@@ -160,7 +161,7 @@ unreportedError = False # any errors not
 for s in itemlist :
     url = s.childNodes[0].data
     try:
-        rdf = urllib.request.urlopen(url, timeout=URL_TIMEOUT).read()
+        rdf = URLopen(url).read()
         rdfxml = ET.fromstring(rdf)
         project = rdfxml[0]
         pjson = {



Mime
View raw message