TXT Output crashes when --max-line-length option is set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When trying ebook-convert (from calibre 5.26.0 on Linux) with TXT output and --max-line-length option set to more than 25, e.g.
ebook-convert d_ch.fb2 text.txt --max-line-length 70
The command crashes with the following error:
.....
Converting XHTML to TXT...
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 45, in <module>
File "site.py", line 41, in main
File "calibre/
File "calibre/
File "calibre/
File "calibre/
File "calibre/
File "calibre/
TypeError: slice indices must be integers or None or have an __index__ method
This is most likely due to the fact that for some reason, in the function cleanup_text, the type of self.opts.
"aaaa aaaa".rfind(" ", 0, 1.0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: slice indices must be integers or None or have an __index__ method
In a Python console.
Included is a patch that fixes this by forcibly converting self.opts.
Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.
status fixreleased