ebook-convert fails with TypeError: Argument must be bytes or unicode, got 'float'

Bug #1933797 reported by Moe Camerun
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

ebook-convert (calibre 4.23.0)

OS: Fedora 33, Linux

Reproducer: Run ebook-convert input.html output.mobi

Stacktrace is:

Traceback (most recent call last):
  File "/usr/bin/ebook-convert", line 20, in <module>
    sys.exit(main())
  File "/usr/lib64/calibre/calibre/ebooks/conversion/cli.py", line 401, in main
    plumber.run()
  File "/usr/lib64/calibre/calibre/ebooks/conversion/plumber.py", line 1274, in run
    self.output_plugin.convert(self.oeb, self.output, self.input_plugin,
  File "/usr/lib64/calibre/calibre/ebooks/conversion/plugins/mobi_output.py", line 213, in convert
    self.write_mobi(input_plugin, output_path, kf8, resources)
  File "/usr/lib64/calibre/calibre/ebooks/conversion/plugins/mobi_output.py", line 245, in write_mobi
    mobimlizer(oeb, opts)
  File "/usr/lib64/calibre/calibre/ebooks/mobi/mobiml.py", line 129, in __call__
    self.mobimlize_spine()
  File "/usr/lib64/calibre/calibre/ebooks/mobi/mobiml.py", line 139, in mobimlize_spine
    self.mobimlize_elem(body, stylizer, BlockState(nbody),
  File "/usr/lib64/calibre/calibre/ebooks/mobi/mobiml.py", line 586, in mobimlize_elem
    self.mobimlize_elem(child, stylizer, bstate, istates)
  File "/usr/lib64/calibre/calibre/ebooks/mobi/mobiml.py", line 586, in mobimlize_elem
    self.mobimlize_elem(child, stylizer, bstate, istates)
  File "/usr/lib64/calibre/calibre/ebooks/mobi/mobiml.py", line 584, in mobimlize_elem
    self.mobimlize_content(tag, text, bstate, istates)
  File "/usr/lib64/calibre/calibre/ebooks/mobi/mobiml.py", line 301, in mobimlize_content
    inline = etree.SubElement(inline, XHTML('font'),
  File "src/lxml/etree.pyx", line 3136, in lxml.etree.SubElement
  File "src/lxml/apihelpers.pxi", line 199, in lxml.etree._makeSubElement
  File "src/lxml/apihelpers.pxi", line 194, in lxml.etree._makeSubElement
  File "src/lxml/apihelpers.pxi", line 317, in lxml.etree._initNodeAttributes
  File "src/lxml/apihelpers.pxi", line 334, in lxml.etree._addAttributeToNode
  File "src/lxml/apihelpers.pxi", line 1538, in lxml.etree._utf8
TypeError: Argument must be bytes or unicode, got 'float'

Revision history for this message
Moe Camerun (spamthemoe) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1933797

I do not provide support for people using distro provided packages. If you are using a distro provided package, uninstall it and install the official calibre binary from https://calibre-ebook.com/download_linux and if you can reproduce the bug with that, re-open the ticket. Of course, if you are already using the official binary, apologies and feel free to re-open the ticket immediately :)

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
Moe Camerun (spamthemoe) wrote :

Hi,

just installed the official binary:

ebook-convert (calibre 5.22.1)

Bug is still reproducible.

Changed in calibre:
status: Invalid → New
Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Revision history for this message
Moe Camerun (spamthemoe) wrote :

Wow, thanks a lot for your effort.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.