Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 10-31-2019, 12:50 PM   #1
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 3,917
Karma: 637184
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Voyage
Reader Pipe Error Running from Source?

I'm seeing errors opening the book reader on epubs while running from source on windows.

I have 4.2.0 binaries installed and I'm current to 6e2122df1754cdc2c5ab32cc13402281b75d19c3 in the source.

The error I get is:

Code:
calibre, version 4.2.0
ERROR: Loading book failed: Failed to open the book at C:\Users\user\Documents\Library\Temporal Knight\Mutant Deviations (9651)\Mutant Deviations - Temporal Knight.epub. Click "Show details" for more info.

Traceback (most recent call last):
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\gui2\viewer\ui.py", line 328, in _load_ebook_worker
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\gui2\viewer\convert_book.py", line 182, in prepare_book
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\gui2\viewer\convert_book.py", line 144, in do_convert
ConversionFailure: Failed to convert book: C:\Users\user\Documents\Library\Temporal Knight\Mutant Deviations (9651)\Mutant Deviations - Temporal Knight.epub with error:
InputFormatPlugin: EPUB Input running
on C:\Users\user\Documents\Library\Temporal Knight\Mutant Deviations (9651)\Mutant Deviations - Temporal Knight.epub
Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main()
P
(Yes, it includes a single 'P' at the end.)

Debug mode doesn't show any additional output.

So am I doing something dumb or is anyone else seeing this?
JimmXinu is offline   Reply With Quote
Old 10-31-2019, 01:05 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 24,600
Karma: 34133293
Join Date: Aug 2009
Location: The Central Coast of California
Device: K4NT(RIP), Galaxy Tab A, Kobo Aura2
FWIW Someone else posted a couple of logs with that single P
theducks is offline   Reply With Quote
Old 10-31-2019, 01:09 PM   #3
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 3,374
Karma: 32493247
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by theducks View Post
FWIW Someone else posted a couple of logs with that single P
Kovid’s response has been:

Quote:
Originally Posted by kovidgoyal View Post
something is likely interfering with the calibre worker process. Try running in safe mode.
jhowell is offline   Reply With Quote
Old 10-31-2019, 01:46 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 36,094
Karma: 15014853
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Try running just the render worker like this:

calibre-debug src/calibre/srv/render_book.py file.epub

that will hopefully give you more details on what the error is.
kovidgoyal is offline   Reply With Quote
Old 10-31-2019, 02:04 PM   #5
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 3,917
Karma: 637184
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Voyage
Spoiler output:

Spoiler:
Code:
InputFormatPlugin: EPUB Input running
on C:\Users\user\Desktop\nook\calibre\Mutant Deviations - Temporal Knight.epub
         113703 function calls (107793 primitive calls) in 0.306 seconds

   Ordered by: cumulative time
   List reduced from 735 to 37 due to restriction <0.05>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.306    0.306 C:\Users\user\Desktop\nook\calibre\src\calibre\srv\render_book.py:857(render)
        1    0.000    0.000    0.211    0.211 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\oeb\iterator\book.py:50(extract_book)
        1    0.000    0.000    0.209    0.209 C:\Users\user\Desktop\nook\calibre\src\calibre\customize\conversion.py:231(__call__)
        1    0.008    0.008    0.208    0.208 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\conversion\plugins\epub_input.py:256(convert)
        1    0.000    0.000    0.167    0.167 C:\Users\user\Desktop\nook\calibre\src\calibre\utils\zipfile.py:1088(extractall)
       26    0.000    0.000    0.167    0.006 C:\Users\user\Desktop\nook\calibre\src\calibre\utils\zipfile.py:1074(extract)
       26    0.139    0.005    0.167    0.006 C:\Users\user\Desktop\nook\calibre\src\calibre\utils\zipfile.py:1104(_extract_member)
        1    0.000    0.000    0.061    0.061 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\meta.py:73(get_metadata)
        1    0.000    0.000    0.061    0.061 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\meta.py:86(_get_metadata)
        1    0.000    0.000    0.056    0.056 C:\Users\user\Desktop\nook\calibre\src\calibre\customize\ui.py:416(get_file_type_metadata)
        1    0.002    0.002    0.056    0.056 C:\Users\user\Desktop\nook\calibre\src\calibre\customize\builtins.py:191(get_metadata)
        1    0.000    0.000    0.051    0.051 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\epub.py:239(get_quick_metadata)
        1    0.000    0.000    0.051    0.051 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\epub.py:216(get_metadata)
        1    0.000    0.000    0.050    0.050 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\opf.py:40(get_metadata)
        5    0.000    0.000    0.040    0.008 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\chardet.py:169(xml_to_unicode)
      484    0.010    0.000    0.038    0.000 {method 'sub' of '_sre.SRE_Pattern' objects}
        1    0.000    0.000    0.033    0.033 C:\Users\user\Desktop\nook\calibre\src\calibre\srv\render_book.py:567(process_exploded_book)
        4    0.000    0.000    0.033    0.008 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\chardet.py:100(substitute_entites)
        2    0.001    0.000    0.032    0.016 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\utils.py:39(parse_opf)
        2    0.003    0.002    0.030    0.015 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\opf2.py:583(__init__)
        1    0.000    0.000    0.029    0.029 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\opf.py:34(get_metadata_from_parsed)
        1    0.000    0.000    0.029    0.029 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\opf.py:25(get_metadata2)
     3987    0.025    0.000    0.028    0.000 C:\Users\user\Desktop\nook\calibre\src\calibre\__init__.py:524(entity_to_unicode)
        2    0.000    0.000    0.025    0.012 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\book\base.py:471(smart_update)
        5    0.000    0.000    0.023    0.005 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\__init__.py:346(MetaInformation)
        7    0.001    0.000    0.022    0.003 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\book\base.py:81(__init__)
        1    0.000    0.000    0.022    0.022 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\opf2.py:643(to_book_metadata)
       54    0.000    0.000    0.019    0.000 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\metadata\book\base.py:476(copy_not_none)
        1    0.000    0.000    0.017    0.017 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\oeb\polish\container.py:256(__init__)
  786/677    0.000    0.000    0.015    0.000 {getattr}
        1    0.000    0.000    0.013    0.013 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\oeb\polish\container.py:295(refresh_mime_map)
       20    0.000    0.000    0.011    0.001 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\oeb\polish\container.py:610(parsed)
        3    0.000    0.000    0.011    0.004 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\oeb\polish\container.py:586(parse)
       15    0.001    0.000    0.011    0.001 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\oeb\polish\container.py:540(opf_xpath)
       26    0.000    0.000    0.010    0.000 shutil.py:60(copyfileobj)
        2    0.001    0.000    0.010    0.005 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\oeb\polish\container.py:200(parse_xml)
       15    0.000    0.000    0.010    0.001 C:\Users\user\Desktop\nook\calibre\src\calibre\ebooks\oeb\polish\container.py:634(opf)


P^@y^@t^@h^@o^@n^@ ^@f^@u^@n^@c^@t^@i^@o^@n^@ ^@t^@e^@r^@m^@i^@n^@a^@t^@e^@d^@ ^@u^@n^@e^@x^@p^@e^@c^@t^@e^@d^@l^@y^@
^@
^@ ^@ ^@'^@N^@o^@n^@e^@T^@y^@p^@e^@'^@ ^@o^@b^@j^@e^@c^@t^@ ^@h^@a^@s^@ ^@n^@o^@ ^@a^@t^@t^@r^@i^@b^@u^@t^@e^@ ^@'^@s^@e^@r^@i^@a^@l^@i^@z^@e^@'^@ ^@(^@E^@r^@r^@o^@r^@ ^@C^@o^@d^@e^@:^@ ^@1^@)^@
^@
^@Traceback (most recent call last):
  File "site.py", line 114, in main
  File "site.py", line 88, in run_entry_point
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\debug.py", line 348, in main
    run_script(args[1], args[2:])
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\debug.py", line 260, in run_script
    exec_path(ef, g)
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\srv\render_book.py", line 932, in <module>
    profile()
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\srv\render_book.py", line 927, in profile
    extract_annotations=True, virtualize_resources=False, max_workers=1
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\srv\render_book.py", line 869, in render
    book_metadata=mi, virtualize_resources=virtualize_resources
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\srv\render_book.py", line 637, in process_exploded_book
    ), container
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\srv\render_book.py", line 476, in __call__
    return [process_book_files(names, *args, container=in_process_container)]
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\srv\render_book.py", line 559, in process_book_files
    transform_html(container, name, virtualize_resources, link_uid, link_to_map, virtualized_names)
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\srv\render_book.py", line 416, in transform_html
    shtml = html_as_json(root)
  File "C:\Users\user\Desktop\nook\calibre\src\calibre\srv\render_book.py", line 763, in html_as_json
    serialize = plugins['html_as_json'][0].serialize
AttributeError: 'NoneType' object has no attribute 'serialize'


I've replaced the character '^@' (AKA \0, or NULL) in the output with the string "^@" so it's visible. That's the source of the single P, I bet.

For legibility, the string without NULLs is: "Python function terminated unexpectedly 'NoneType' object has no attribute 'serialize' (Error Code: 1)"
JimmXinu is offline   Reply With Quote
Old 10-31-2019, 02:15 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 36,094
Karma: 15014853
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
that should take care of it, the prepare book process has been greatly speeded up, but you need a native code module for it which you wont get till calibre 4.3 is released https://github.com/kovidgoyal/calibr...a71e4cad2d38b2
kovidgoyal is offline   Reply With Quote
Old 10-31-2019, 02:22 PM   #7
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 3,917
Karma: 637184
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Voyage
Confirmed--I'm not getting that error now. Thanks!

And thanks for the upcoming pre-process speed up, that's great news!
JimmXinu is offline   Reply With Quote
Old 10-31-2019, 03:06 PM   #8
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 3,374
Karma: 32493247
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Is is possible to also fix Python exception error messages so that they do not contains null characters?

I am seeing these whenever any of the calibre command line programs errors out.
jhowell is offline   Reply With Quote
Old 11-01-2019, 02:20 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 36,094
Karma: 15014853
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by jhowell View Post
Is is possible to also fix Python exception error messages so that they do not contains null characters?

I am seeing these whenever any of the calibre command line programs errors out.
yeah its a windows specific thing, need to look into it when I am next on a windows machine.
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin error: IOError: [Errno 32] Broken pipe stoduk Development 6 12-30-2015 08:14 AM
ERROR: Unhandled exception: <b>IOError</b>:[Errno 32] Broken pipe Martin77 Calibre 3 12-24-2015 08:50 AM
running from source dbus error eschwartz Calibre 7 10-30-2014 01:15 AM
Error while running calibre with source Lev667 Development 3 03-05-2011 10:55 AM
Running from source after V0.7.32 chaley Calibre 0 12-04-2010 01:08 PM


All times are GMT -4. The time now is 03:09 AM.


MobileRead.com is a privately owned, operated and funded community.