[sysadmin-bin] Let ElementTree process the encoding itself by requesting the undecoded data from Python requests



commit eef05358c1c805071f1047c25b298cc7c6c8e459
Author: Andrea Veri <av gnome org>
Date:   Fri Dec 4 09:50:52 2015 +0100

    Let ElementTree process the encoding itself by requesting the undecoded data from Python requests

 git/post-receive-mirror-github |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/git/post-receive-mirror-github b/git/post-receive-mirror-github
index e5e6674..145e26e 100755
--- a/git/post-receive-mirror-github
+++ b/git/post-receive-mirror-github
@@ -86,7 +86,7 @@ class GitHub:
     def normalize_name (self, name):
         if name in name_maps.keys():
             return name_maps[name]
-  
+
         if "+" in name:
             raise Exception("%s has a '+' character in it which is unsupported by Github.\nYou have to add 
it to the exception maps in the post-update hook." % name)
 
@@ -107,9 +107,9 @@ def get_repo_settings (repo_name):
 
     rq = requests.get(doap_url)
     if rq.status_code != 200:
-        raise Exception ("Could not get doap: %s" % doap_url)        
+        raise Exception ("Could not get doap: %s" % doap_url)
 
-    prj = et.fromstring (rq.text)
+    prj = et.fromstring(rq.content)
 
     resource = '{%s}resource' % nss['rdf']
 


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