Skip to content

Commit d807080

Browse files
committed
let's see if THIS does the trick.
1 parent 426abbe commit d807080

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

textile/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ def generate_tag(tag, content, attributes=None):
7272
except AttributeError:
7373
# Python 2.6 doesn't have the tostringlist method, so we have to treat
7474
# it differently.
75+
attributes = dict(map(lambda (k, v): (k, v.decode(enc)),
76+
attributes.items()))
77+
element = ElementTree.Element(tag, attrib=attributes)
7578
element_tag = ElementTree.tostring(element, encoding=enc)
76-
element_tag = [v.decode(enc) for v in element_tag]
7779
element_text = re.sub(r"<\?xml version='1.0' encoding='UTF-8'\?>\n",
7880
'', element_tag)
7981
if content != six.text_type(' /'):

0 commit comments

Comments
 (0)