View Single Post
Old 02-15-2020, 07:12 PM   #13
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by Marco77 View Post
Hello,
So I've run into this case when the plugin crashes on clicking scramble, the input file not being compliant (missing metadata element in opf)

Code:
for child in [e for e in self.eb.opf_xpath('//opf:metadata')[0]]:
(IndexError: list index out of range)

dunno if you're willing to fix this since it's an edge case, but it might be better to add a try except handling just in case things go south unpredictably.
Hmm. I think you might have a good point. My notes say that this particular bit of code was added to remove metadata cruft from Amazon books. If there's none to remove then the plugin really shouldn't fall in a heap. I've made an assumption that an OPF file always has a <metadata> section and perhaps I shouldn't have. Does calibre's CheckBook and/or epubcheck flag errors with this book?

I'm due to release an update soon to prepare for calibre's python2 to python3 update later this year so I'll have a look at this before release.

If you're willing I'd really like to have a look at this book myself in case it triggers other unexpected errors. Would it be possible to PM me a link?
jackie_w is offline   Reply With Quote