Commit 947fffe8 authored by Emmy Vouriot's avatar Emmy Vouriot Committed by Jérome Perrin

WIP: Python 2 to 3 fixes

parent 6f981de8
......@@ -145,7 +145,6 @@ class ImageFieldWidget(Widget.TextWidget):
if value in ('', None):
return None
path = '/'.join(REQUEST.physicalPathFromURL(value))
path = path.encode()
image_object = field.getPortalObject().restrictedTraverse(path)
display = field.get_value('image_display')
format = field.get_value('image_format')
......
......@@ -1107,7 +1107,7 @@ class ODGStrategy(ODFStrategy):
text_xpath = '//draw:frame[@draw:name="%s"]' % field.id
node_list = element_tree.xpath(text_xpath, namespaces=element_tree.nsmap)
value = field.get_value('default')
if isinstance(value, str):
if isinstance(value, bytes):
value = value.decode('utf-8')
for target_node in node_list:
# render the field in odg xml node format
......
......@@ -82,10 +82,7 @@ class OOoBuilder(Implicit):
dat = document.data
while dat is not None:
self._document.write(dat.data)
if six.PY2:
dat = dat.next
else:
dat = dat.__next__
dat = dat.next
else:
# Default behaviour
self._document.write(document.data)
......
Markdown is supported
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