mattharrison / rst2odp

Create OpenOffice.org (impress) slideshows from restructured text (rst) or python
MIT License
27 stars 16 forks source link

AttributeError: 'bytes' object has no attribute 'encode' #36

Closed Fale closed 8 years ago

Fale commented 8 years ago
rst2odp --template-file=2014.otp --traceback intro.rst intro.odp

Output:

Traceback (most recent call last):
  File "/usr/bin/rst2odp", line 1308, in <module>
    sys.exit(main(sys.argv) or 0)
  File "/usr/bin/rst2odp", line 1297, in main
    enable_exit_status=enable_exit_status)
  File "/usr/lib/python3.5/site-packages/docutils/core.py", line 219, in publish
    output = self.writer.write(self.document, self.destination)
  File "/usr/lib/python3.5/site-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/usr/bin/rst2odp", line 210, in translate
    self.visitor = self.translator_class(self.document)
  File "/usr/bin/rst2odp", line 225, in __init__
    self.preso.set_template(self.settings.template_file)
  File "/usr/lib/python3.5/site-packages/odplib/preso.py", line 368, in set_template
    self.template_files.append(Template(template_file))
  File "/usr/lib/python3.5/site-packages/odplib/preso.py", line 1844, in __init__
    self.set_filepath(filepath)
  File "/usr/lib/python3.5/site-packages/odplib/preso.py", line 1849, in set_filepath
    self.styles = et.fromstring(self.zipfile.cat('styles.xml').encode('utf-8'))
AttributeError: 'bytes' object has no attribute 'encode'

Not really sure if mixing one random content and one random template file shoul work in the first place