View Single Post
Old 05-28-2012, 03:07 AM   #222
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,731
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Normally I run from the latest source code and the last binary install I had done was 0.8.52 (everything working fine). I just installed the binaries for 0.8.53, then I also find that calibre crashes with 0.8.53 (but only when scanning PDF files.)

Which implies that perhaps Kovid "broke something" in the PDF code (which being C++ is the most likely thing to cause such a crash).

@Kovid - here is what my code does where I believe it is crashing:
Spoiler:
Code:
    def _read_pdf_txt(self, book_path, start_page, end_page):
        from calibre.constants import plugins
        pdfreflow, pdfreflow_err = plugins['pdfreflow']
        with open(book_path, 'rb') as stream:
            tdir = PersistentTemporaryDirectory('_isbn')
            with CurrentDir(tdir):
                pages = pdfreflow.reflow(stream.read(), start_page, end_page)
                with open('index.xml', 'rb') as f:
                    xml = f.read()
                    #open('E:\\%d.xml'%start_page,'wb').write(xml)
        root = etree.fromstring(clean_ascii_chars(xml))
        txt = etree.tostring(root, method='text', encoding=unicode)
        return (pages, txt)
kiwidude is offline   Reply With Quote