diff --git a/src/sugar3/bundle/activitybundle.py b/src/sugar3/bundle/activitybundle.py index 879831e5..2b5e2f44 100644 --- a/src/sugar3/bundle/activitybundle.py +++ b/src/sugar3/bundle/activitybundle.py @@ -129,7 +129,7 @@ class ActivityBundle(Bundle): def _parse_info(self, info_file): cp = ConfigParser() - cp.readfp(info_file) + cp.read_string(info_file.read().decode()) section = 'Activity' @@ -251,7 +251,7 @@ class ActivityBundle(Bundle): def _parse_linfo(self, linfo_file): cp = ConfigParser() try: - cp.readfp(linfo_file) + cp.read_string(linfo_file.read().decode()) section = 'Activity' diff --git a/src/sugar3/bundle/bundle.py b/src/sugar3/bundle/bundle.py index c5716107..206409a6 100644 --- a/src/sugar3/bundle/bundle.py +++ b/src/sugar3/bundle/bundle.py @@ -115,7 +115,7 @@ class Bundle(object): if self._zip_file is None: path = os.path.join(self._path, filename) try: - f = open(path, 'r') + f = open(path, 'rb') except IOError: logging.debug("cannot open path %s" % path) return None @@ -123,7 +123,7 @@ class Bundle(object): path = os.path.join(self._zip_root_dir, filename) try: data = self._zip_file.read(path) - f = six.StringIO(data) + f = six.BytesIO(data) except KeyError: logging.debug('%s not found in zip %s.' % (filename, path)) return None