Commit 32ed77ff authored by Simon Chabot's avatar Simon Chabot
Browse files

[fix, calendar] Ensure that the buffer is a string

'unicode' is not defined in python3

branch : 3.26
parent b748fa6b5796
......@@ -23,6 +23,7 @@ from cubicweb import _
import copy
from datetime import timedelta
import six
from logilab.mtconverter import xml_escape
from import todatetime
......@@ -100,9 +101,7 @@ try:
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)
except ImportError:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment