community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1712360 - /comdev/reporter.apache.org/trunk/scripts/urlutils.py
Date Tue, 03 Nov 2015 18:04:16 GMT
Author: sebb
Date: Tue Nov  3 18:04:16 2015
New Revision: 1712360

URL: http://svn.apache.org/viewvc?rev=1712360&view=rev
Log:
More Python2 fixing

Modified:
    comdev/reporter.apache.org/trunk/scripts/urlutils.py

Modified: comdev/reporter.apache.org/trunk/scripts/urlutils.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/urlutils.py?rev=1712360&r1=1712359&r2=1712360&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/urlutils.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/urlutils.py Tue Nov  3 18:04:16 2015
@@ -15,6 +15,7 @@ try:
 except:
     from urllib2 import urlopen, Request
     from urllib2 import HTTPError
+    from io import open # needed for encoding
     _PY3 = False
 
 import time
@@ -193,12 +194,12 @@ class UrlCache(object):
             return open(target, 'rb')
 
 if __name__ == '__main__':
+    fc2 = UrlCache(cachedir=None,interval=0)
+    fc2.get("https://svn.apache.org/repos/asf/subversion/README","README", encoding='utf-8')
     fc = UrlCache(cachedir=None,interval=10)
     GIT='https://git-wip-us.apache.org/repos/asf?p=infrastructure-puppet.git;hb=refs/heads/deployment;a=blob_plain;f=modules/subversion_server/files/authorization/'
     ASF='asf-authorization-template'
     fc.get(GIT+ASF,ASF)
     fc.get("https://svn.apache.org/repos/asf/subversion/README","README")
-    fc2 = UrlCache(cachedir=None,interval=0)
-    fc2.get("https://svn.apache.org/repos/asf/subversion/README","README")
     print("Done")
     
\ No newline at end of file



Mime
View raw message