[fix, calendar] Ensure that the buffer is a string
'unicode' is not defined in python3
--- a/cubicweb/web/views/calendar.py Thu Mar 05 10:41:30 2020 +0100
+++ b/cubicweb/web/views/calendar.py Thu Mar 05 16:03:26 2020 +0100
@@ -23,6 +23,7 @@
import copy
from datetime import timedelta
+import six
from logilab.mtconverter import xml_escape
from logilab.common.date import todatetime
@@ -100,9 +101,7 @@
if ical_task.stop:
elt.add(stop_kw).value = ical_task.stop
- buff = ical.serialize()
- if not isinstance(buff, unicode):
- buff = unicode(buff, self._cw.encoding)
+ buff = six.ensure_str(ical.serialize(), encoding=self._cw.encoding)
self.w(buff)
except ImportError: