diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2011-06-07 15:05:58 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2011-06-07 15:05:58 +0000 |
| commit | 6f0e663b5914c22240376b3e84feb0e70bfbbd80 (patch) | |
| tree | badd61727ceefc4d8c990b5bfd9aaf4fee019c55 /docutils | |
| parent | 9b888e14d17ad8f1fcf4f7506ab3d5cecd41674b (diff) | |
| download | docutils-6f0e663b5914c22240376b3e84feb0e70bfbbd80.tar.gz | |
Apply tuple_args_guard.patch [ 2993967 ]
When there are any attributes which have tuple attribute values DOM
rendering fails because string interpolation receives a wrong number
of arguments. It needs to be safeguarded against this case by
carefully packing the values into a tuple beforehand.
This problem might crop up in other places as well.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7054 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
| -rw-r--r-- | docutils/docutils/nodes.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index afb541fb9..9a868cd1b 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -461,7 +461,7 @@ class Element(Node): element = domroot.createElement(self.tagname) for attribute, value in self.attlist(): if isinstance(value, list): - value = ' '.join([serial_escape('%s' % v) for v in value]) + value = ' '.join([serial_escape('%s' % (v,)) for v in value]) element.setAttribute(attribute, '%s' % value) for child in self.children: element.appendChild(child._dom_node(domroot)) @@ -505,7 +505,7 @@ class Element(Node): if value is None: # boolean attribute parts.append(name) elif isinstance(value, list): - values = [serial_escape('%s' % v) for v in value] + values = [serial_escape('%s' % (v,)) for v in value] parts.append('%s="%s"' % (name, ' '.join(values))) else: parts.append('%s="%s"' % (name, value)) |
