Error when converting to pdb ereader

Bug #1954889 reported by Nathan Lewis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

I'm using 5.33.2. When I try to convert a book to pdb ereader format I get an error. I don't get this error when converting to pdb doc format. I don't get this error in 3.20.0 (I've got it installed on an older computer) when trying to convert the identical file. I get the same error message with various different source books. I'm using Windows 10.

Error message (full source file and error report are in the attachment):

Converting index.html to PML markup...
Traceback (most recent call last):
  File "runpy.py", line 194, in _run_module_as_main
  File "runpy.py", line 87, in _run_code
  File "site.py", line 82, in <module>
  File "site.py", line 77, in main
  File "site.py", line 49, in run_entry_point
  File "calibre\utils\ipc\worker.py", line 216, in main
  File "calibre\gui2\convert\gui_conversion.py", line 41, in gui_convert_override
  File "calibre\gui2\convert\gui_conversion.py", line 28, in gui_convert
  File "calibre\ebooks\conversion\plumber.py", line 1284, in run
  File "calibre\ebooks\conversion\plugins\pdb_output.py", line 61, in convert
  File "calibre\ebooks\pdb\ereader\writer.py", line 70, in write_content
TypeError: a bytes-like object is required, not 'str'

Thanks in advance for helping.

Revision history for this message
Nathan Lewis (nathan-lewis) wrote :
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
Nathan Lewis (nathan-lewis) wrote :

Nice work fixing it so quickly, thanks!

Revision history for this message
Nathan Lewis (nathan-lewis) wrote :

Hi again.

While the bug fix worked for the given simple sample file, it still fails with a more complex source with the following error:

Traceback (most recent call last):
  File "runpy.py", line 194, in _run_module_as_main
  File "runpy.py", line 87, in _run_code
  File "site.py", line 82, in <module>
  File "site.py", line 77, in main
  File "site.py", line 49, in run_entry_point
  File "calibre\utils\ipc\worker.py", line 216, in main
  File "calibre\gui2\convert\gui_conversion.py", line 41, in gui_convert_override
  File "calibre\gui2\convert\gui_conversion.py", line 28, in gui_convert
  File "calibre\ebooks\conversion\plumber.py", line 1284, in run
  File "calibre\ebooks\conversion\plugins\pdb_output.py", line 61, in convert
  File "calibre\ebooks\pdb\ereader\writer.py", line 43, in write_content
  File "calibre\ebooks\pdb\ereader\writer.py", line 113, in _index_item
  File "re.py", line 210, in sub
TypeError: sequence item 0: expected a bytes-like object, str found

It looks like the same type of problem but elsewhere in the code.

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1954889
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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