#1122636 python-odf-tools: odfmeta crashes due to an undefined unicode function

#1122636#5
Date:
2025-12-12 01:24:43 UTC
From:
To:
Dear Maintainer,

The odfmeta command fails when using the -I option. It first crashes with an
error due to an undefined unicode function. After manually removing the
unicode() call in the source code, it encounters further errors when writing
the output file.

Steps to reproduce:

- Run:

/bin/odfmeta -I 'Creator=Test User <test@example.com>' -o ./output.odt input.odt

The tool crashes with:

Traceback (most recent call last):
  File "/bin/odfmeta", line 190, in <module>
    addfields[k] = unicode(v,'utf-8')
                   ^^^^^^^
NameError: name 'unicode' is not defined

- Modify the source code to remove or comment out unicode() calls.
- Run the command again. The tool now fails with:

Traceback (most recent call last):
  File "/tmp/odfmeta", line 255, in <module>
    zout.writestr(zi,odfs.meta() )
                     ~~~~~~~~~^^
  File "/tmp/odfmeta", line 159, in meta
    return self.output.content()
           ~~~~~~~~~~~~~~~~~~~^^
  File "/tmp/odfmeta", line 83, in content
    return ''.join(self._content)
           ~~~~~~~^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, bytes found

Additional info:
The manual fix to remove unicode() allows the tool to proceed but reveals
further errors during output file generation.