# HG changeset patch # User Simon Chabot # Date 1583420606 -3600 # Node ID d1c953c97d3955af795440849b3464ae457671a9 # Parent b748fa6b5796a7f7da32f6cdedf3e9831be3f9ec [fix, calendar] Ensure that the buffer is a string 'unicode' is not defined in python3 diff -r b748fa6b5796 -r d1c953c97d39 cubicweb/web/views/calendar.py --- 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: