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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-04-2011, 11:00 AM   #1
nimblebooks
Enthusiast
nimblebooks began at the beginning.
 
Posts: 28
Karma: 10
Join Date: May 2010
Device: Kindle
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL by

What does this mean? (error is at bottom) building an ePub from a collection of HTML documents.

Where does it think the NULL character is?

Quote:
...

Generating default cover
Traceback (most recent call last):
File "/usr/bin/ebook-convert", line 19, in <module>
sys.exit(main())
File "/usr/lib/calibre/calibre/ebooks/conversion/cli.py", line 254, in main
plumber.run()
File "/usr/lib/calibre/calibre/ebooks/conversion/plumber.py", line 886, in run
self.opts, self.log)
File "/usr/lib/calibre/calibre/ebooks/epub/output.py", line 176, in convert
oeb_output.convert(oeb, tdir, input_plugin, opts, log)
File "/usr/lib/calibre/calibre/ebooks/oeb/output.py", line 31, in convert
results = oeb_book.to_opf2(page_map=True)
File "/usr/lib/calibre/calibre/ebooks/oeb/base.py", line 1907, in to_opf2
results[NCX_MIME] = (href, self._to_ncx())
File "/usr/lib/calibre/calibre/ebooks/oeb/base.py", line 1880, in _to_ncx
self.toc.to_ncx(navmap)
File "/usr/lib/calibre/calibre/ebooks/oeb/base.py", line 1593, in to_ncx
element(point, NCX('content'), src=urlunquote(node.href))
File "/usr/lib/calibre/calibre/ebooks/oeb/base.py", line 240, in element
return etree.SubElement(parent, *args, **kwargs)
File "lxml.etree.pyx", line 2437, in lxml.etree.SubElement (src/lxml/lxml.etree.c:47345)
File "apihelpers.pxi", line 210, in lxml.etree._makeSubElement (src/lxml/lxml.etree.c:11391)
File "apihelpers.pxi", line 205, in lxml.etree._makeSubElement (src/lxml/lxml.etree.c:11327)
File "apihelpers.pxi", line 283, in lxml.etree._initNodeAttributes (src/lxml/lxml.etree.c:12162)
File "apihelpers.pxi", line 1242, in lxml.etree._utf8 (src/lxml/lxml.etree.c:19848)
nimblebooks is offline   Reply With Quote
Old 11-04-2011, 11:05 AM   #2
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 30,842
Karma: 85467920
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Perhaps in one of the names of the HTML documents? It's hard to tell without looking at the source code.
pdurrant is offline   Reply With Quote
 
Enthusiast
Old 11-04-2011, 11:38 AM   #3
nimblebooks
Enthusiast
nimblebooks began at the beginning.
 
Posts: 28
Karma: 10
Join Date: May 2010
Device: Kindle
This is the command that invokes:

sudo ebook-convert tmp/temptoc.html zz_delivery/zimzaztest.epub

(run without options to isolate errors)

this is the directory it is running against

rw-r--r-- 1 bitnami root 105892 2011-11-04 14:21 1.html
-rw-r--r-- 1 bitnami root 318260 2011-11-04 14:21 2.html
-rw-r--r-- 1 bitnami root 47016 2011-11-04 14:21 3.html
-rw-r--r-- 1 bitnami root 204 2011-11-04 14:21 temptoc.html

I did a little digging around and used od -b to convert these files to octal, then grep ' 000' to see if there are any null characters; nope.

So I'm stumped.

The full script is pretty long and doing a lot of stuff to gather the html files so I am trying to avoid posting it.
nimblebooks is offline   Reply With Quote
Old 11-04-2011, 11:43 AM   #4
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 30,842
Karma: 85467920
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Quote:
Originally Posted by nimblebooks View Post
this is the directory it is running against

rw-r--r-- 1 bitnami root 105892 2011-11-04 14:21 1.html
-rw-r--r-- 1 bitnami root 318260 2011-11-04 14:21 2.html
-rw-r--r-- 1 bitnami root 47016 2011-11-04 14:21 3.html
-rw-r--r-- 1 bitnami root 204 2011-11-04 14:21 temptoc.html
I have a vague memory that XML ids shouldn't begin with numbers, so it might be that the file names 1.html, etc are causing problems with various bits of the generated ePub. It might be worth trying again with them names a1.html, a2.html, etc.
pdurrant is offline   Reply With Quote
Old 11-04-2011, 12:01 PM   #5
nimblebooks
Enthusiast
nimblebooks began at the beginning.
 
Posts: 28
Karma: 10
Join Date: May 2010
Device: Kindle
I substituted a new vanilla 1.html file for the 3 existing files and the build worked fine, so that probably wasn't the problem. The previous files are about Japanese aircraft carriers so it may have something to do with non-Unicode characters (just guessing). I am looking for a way to verify whether a file contains any non-Unicode characters.
nimblebooks is offline   Reply With Quote
Old 11-04-2011, 12:38 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: 25,437
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
From the traceback that looks like an outdated calibre version. I suggest updating to the latest, 0.8.24. Also on windows, calibre can occassionaly have trouble with files whose names contains non ascii characters, removing those characters usually resolves the issue.

Last edited by kovidgoyal; 11-04-2011 at 01:23 PM.
kovidgoyal is online now   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
searhc:null? cypherslock Kobo Tablets 0 11-03-2011 12:28 PM
Fetch News failing (All strings must be XML compatible nuveen Recipes 11 10-01-2011 12:01 PM
Template error value:unknown field null sfuller Calibre 4 06-13-2011 03:02 PM
Help a beginner:Python/Recipe Unicode and ASCII Starson17 Calibre 2 02-15-2010 11:10 AM
Converting non-ascii/non-unicode text - pictures the way to go? politicorific Workshop 5 04-02-2009 05:59 AM


All times are GMT -4. The time now is 01:37 AM.


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