[gsoc-admin] get_main_data_from_section: Decode data



commit 40e554832f5fe402f05c03e2a142d62f27b182b7
Author: Lasse Schuirmann <lasse schuirmann gmail com>
Date:   Wed Aug 12 14:54:02 2015 +0200

    get_main_data_from_section: Decode data

 maillib/config.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/maillib/config.py b/maillib/config.py
index 3cade5d..d467fca 100644
--- a/maillib/config.py
+++ b/maillib/config.py
@@ -6,6 +6,7 @@ import csv
 from ics import Calendar
 import re
 from urllib import request
+import sys
 
 from maillib.email import Contact, EmailTemplate
 
@@ -29,11 +30,11 @@ def get_main_data_from_section(section):
     assert ('url' in section) != ('path' in section)
     if 'url' in section:
         source = apply_substitutions(section['url'])
-        return request.urlopen(source).read()
+        return request.urlopen(source).read().decode()
     else:
         source = apply_substitutions(section['path'])
         with open(source) as file:
-            return file.read()
+            return file.read().decode()
 
 
 class EventConfig:


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