Error message when opening unsupported filetypes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Expired
|
Undecided
|
Unassigned |
Bug Description
## Summary
I tried to open a CHM file. Calibre doesn't support CHM files. That's fine, but it should display a more intelligible message explaining that filetype support is the issue, rather than the unintelligible error message that I received.
## Steps to reproduce
1. Add a Microsoft Compiled HTML Help (CHM) file to the Calibre library
2. Select the book
3. Open a context menu for the book
4. Select View/"View with calibre e-book viewer".
5. I see the following error dialog:
ERROR: Could not open e-book: 'NoneType' object is not iterable
6. Click "Show details"
7. I see this:
Traceback (most recent call last):
File "/usr/lib/
Thread.
File "/usr/lib/
self.
File "/usr/lib/
ordered = [i for i in self.opf.spine if i.is_linear] + \
TypeError: 'NoneType' object is not iterable
## Environment
calibre, version 3.21.0
Ubuntu 18.04.3 LTS
But calibre *does* support the .chm filetype, it's one of the explicitly /manual. calibre- ebook.com/ faq.html# what-formats- does-calibre- support- conversion- to-from
advertised input formats here:
https:/
The calibre e-book viewer automatically supports all conversion formats,
in fact, internally it will actually convert these formats to the common
base representation for reading.
In the event that a format is not supported, you will instead get this
error message (try creating a dummy file called foo.sdfsdffds, which is
definitely not a supported ebook type):
calibre, version 3.99.7
ERROR: Loading book failed: Failed to open the book at foo.sdfsdffds.
Click "Show details" for more info.
Traceback (most recent call last): eschwartz/ git/calibre/ src/calibre/ utils/ipc/ simple_ worker. py", :func(* args, **kwargs)} eschwartz/ git/calibre/ src/calibre/ srv/render_ book.py" , pathtoebook, output_dir, book_hash= book_hash, data=extract_ annotations, book_metadata=mi) eschwartz/ git/calibre/ src/calibre/ srv/render_ book.py" , book(path_ to_ebook, tdir, eschwartz/ git/calibre/ src/calibre/ ebooks/ oeb/iterator/ book.py" , pathtoebook, tdir, log, view_kepub= view_kepub) eschwartz/ git/calibre/ src/calibre/ ebooks/ conversion/ plumber. py",
File
"/home/
line 290, in main
res = {'result'
File "/home/
line 614, in render
container = Container(
save_bookmark_
File "/home/
line 180, in __init__
book_fmt, opfpath, input_fmt = extract_
log=log)
File
"/home/
line 54, in extract_book
plumber = Plumber(
File
"/home/
line 755, in __init__
raise ValueError('No plugin to handle input format: '+input_fmt)
ValueError: No plugin to handle input format: sdfsdffds
Note the last line: "no plugin to handle input format". This is a pretty
clear error message.
In fact, under Preferences, you can select CHM as one of the formats
which is permitted to be opened in the internal viewer.
Your error message is much different -- it says that the calibre e-book
viewer thought it could read the chm file, started opening it, and then
hit an internal logic error which it should never hit, freaked out, and
dumped a developer debug error.
The answer to your problem is... I don't know why you get that error,
but why are you using an ancient, end of life version 3.21.0?
I can tell you that I have just successfully tested opening a chm ebook
right now, and it worked perfectly, so clearly this "should" work.
Either something is wrong with your ancient copy of calibre, or
something is strange about your chm file.
Since you seem to be using the version of calibre from the Ubuntu
software repositories, I am going to hazard a guess that the problem is
Ubuntu's notoriously modified copy of calibre is to blame. Either that,
or whatever bug you manifested, has long been fixed. It is noteworthy
that the calibre developer does not support Linux distribution packages,
so if you cannot reproduce your error using the official binary
distribution, he will simply tell you "your distro is buggy, report a
bug to them".
Please update to the latest version of calibre, which you can obtain /calibre- ebook.com/ download_ linux
from here: https:/
If you can still produce the error using the latest prebuilt binaries,
...