aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMart Raudsepp <leio@gentoo.org>2016-12-04 09:59:39 +0200
committerMart Raudsepp <leio@gentoo.org>2016-12-04 09:59:39 +0200
commitdac532df96cb16626f4f1656b5aa2f82b8383c8d (patch)
tree16161f5ca3a29f1bd40db327101b93b7199b4031
parentsync: Update individual maintainer names during projects sync for the time being (diff)
downloadgrumpy-dac532df96cb16626f4f1656b5aa2f82b8383c8d.tar.gz
grumpy-dac532df96cb16626f4f1656b5aa2f82b8383c8d.tar.bz2
grumpy-dac532df96cb16626f4f1656b5aa2f82b8383c8d.zip
sync: Fix UTF-8 handling for projects.xml import
Need to feed response.content bytestring into ElementTree, not response.text. With the latter ET seems to figure it's already decoded and goes all latin-1 on us. From response.content bytestream it notices the UTF-8 encoding XML markup and does things right. Diagnosed-by: Doug Freed <dwfreed@mtu.edu>
-rw-r--r--backend/lib/sync.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/lib/sync.py b/backend/lib/sync.py
index 4894315..22419bf 100644
--- a/backend/lib/sync.py
+++ b/backend/lib/sync.py
@@ -13,7 +13,7 @@ def get_project_data():
if not data:
print("Failed retrieving projects.xml")
return
- root = ET.fromstring(data.text)
+ root = ET.fromstring(data.content)
projects = {}
# Parsing is based on http://www.gentoo.org/dtd/projects.dtd as of 2016-11-10
if root.tag.lower() != 'projects':