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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 05-19-2010, 07:56 PM   #1
zhoujianfu
Junior Member
zhoujianfu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2010
Device: iPad
ebook-convert vs windows version

Hi!

I have 0.6.51 installed on windows 7 but also on an ubuntu server, and when I try to use ebook-convert in the unix command line, it doesn't have as much success as opening the books in windows and running convert from the gui.

Are these implementations somehow different? I have a lot of files (which I can attach) that convert okay via the windows 0.6.51 but give various errors when running ebook-convert on them (to the epub format). Of course, plenty of files work fine in both too!

Is this a known issue? Should I create a bug? I couldn't find anything about it in the bug tracker. Should I upload the actual ebooks?

Thanks Kovid, or anybody!

josh!

P.S. here's one example .fb2 file that converted okay in the gui but got this error using ebook-convert (with no options, to epub):

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 905, in run
self.opts, self.log)
File "/usr/lib/calibre/calibre/ebooks/epub/output.py", line 159, in convert
self.workaround_ade_quirks()"
File "/usr/lib/calibre/calibre/ebooks/epub/output.py", line 474, in workaround_ade_quirks"
for rule in stylesheet.data.cssRules.rulesOfType(CSSRule.STYLE _RULE):"
AttributeError: 'CSSRuleList' object has no attribute 'rulesOfType'

I'll attach it renamed to .txt because .fb2 seems to be not an allowed attachment type!
zhoujianfu is offline   Reply With Quote
Old 05-20-2010, 01:09 AM   #2
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: 26,325
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
you need to upgrade

cssutils to atleast 0.9.7a3
kovidgoyal is online now   Reply With Quote
Old 05-20-2010, 02:14 PM   #3
zhoujianfu
Junior Member
zhoujianfu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2010
Device: iPad
Awesome, that worked, thanks a bunch!

Heh.. now I still have just one other error on a few files, something to do with character sets..

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 26: ordinal not in range(128)

I'm just running "ebook-convert david.lit david.epub"

one more time help please?

thanks a ton!
Attached Files
File Type: lit David Eddings - Gambit Magów.lit (326.3 KB, 62 views)
zhoujianfu is offline   Reply With Quote
Old 05-20-2010, 03:16 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: 26,325
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
post the full error message
kovidgoyal is online now   Reply With Quote
Old 05-20-2010, 03:33 PM   #5
Turt99
Connoisseur
Turt99 began at the beginning.
 
Posts: 92
Karma: 14
Join Date: Apr 2010
Device: Kindle Paperwhite
hrm, I was having similar issues with book converting for me in windows but not in linux, I upgraded my Calibre in linux and that helped a little but I will have to look into this more maybe I need to update something else too.
Turt99 is offline   Reply With Quote
Old 05-20-2010, 08:15 PM   #6
zhoujianfu
Junior Member
zhoujianfu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2010
Device: iPad
Sure, sorry about that!

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 905, in run
self.opts, self.log)
File "/usr/lib/calibre/calibre/ebooks/epub/output.py", line 190, in convert
oeb_output.convert(oeb, tdir, input_plugin, opts, log)
File "/usr/lib/calibre/calibre/ebooks/oeb/output.py", line 45, in convert
path = os.path.abspath(unquote(item.href))
File "/usr/lib/calibre/calibre/startup.py", line 80, in my_abspath
path = path.encode(encoding)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 26: ordinal not in range(128)"
zhoujianfu is offline   Reply With Quote
Old 05-20-2010, 11:28 PM   #7
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: 26,325
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
your linux system proabbly isn't set up correctly with a utf-8 locale

what does

locale

return
kovidgoyal is online now   Reply With Quote
Old 05-20-2010, 11:57 PM   #8
zhoujianfu
Junior Member
zhoujianfu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2010
Device: iPad
Hmm!

# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Does that seem okay?

Thanks again!
zhoujianfu is offline   Reply With Quote
Old 05-21-2010, 12:02 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: 26,325
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
calibre-debug -c "from calibre.constants import preferred_encoding, filesystem_encoding; print preferred_encoding, filesystem_encoding"
kovidgoyal is online now   Reply With Quote
Old 05-21-2010, 02:04 AM   #10
zhoujianfu
Junior Member
zhoujianfu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2010
Device: iPad
I ran that and got:

UTF-8 UTF-8
zhoujianfu is offline   Reply With Quote
Old 05-21-2010, 02:26 AM   #11
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: 26,325
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
that doesn't ake any sense, the error is complaining about using the ascii encoding but you're saying the encoding is utf-8

are you launching ebook-convert from some sort of special environment?
kovidgoyal is online now   Reply With Quote
Old 05-21-2010, 08:51 AM   #12
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,797
Karma: 1216080
Join Date: Jan 2010
Location: France
Device: Many android devices
Calibre is clearly trying to convert str() to unicode, in this case (assuming latin-1) the character ó. This could happen if command line arguments are bytestrings instead of unicode (and I think they are). It wouldn't happen in the GUI, because it represents and processes paths in UTF-8.

If I am right, things should work if there are no non-ASCII characters anywhere in the full pathname of the book.
chaley is offline   Reply With Quote
Old 05-21-2010, 02:08 PM   #13
zhoujianfu
Junior Member
zhoujianfu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2010
Device: iPad
Ah, dohhh!

My apologies, I ran locale and that test command as ROOT and then I've been running the ebook-convert as a user. Running locale as the user gives "POSIX"! I've switched the user to utf-8 and it worked!

(chaley, it looks like the filename part didn't matter.. when I renamed it to just ascii "duh.lit" it still wouldn't convert when I had the wrong locale, and when I keep it with a funny character in the filename it still works as long as I have the right locale!)

Thanks again!!
zhoujianfu 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
Windows 7 New Calibre Version problem Pandzilla Calibre 8 10-03-2010 03:15 PM
EPUB generated by ebook-convert does not open gracefully on windows Heritage History Calibre 4 07-08-2010 02:37 PM
Freda ebook software for Windows Mobile release version 1. pilotbob News 5 12-13-2009 10:32 AM
New version of eBook Library for Windows mwheinz Sony Reader 8 11-14-2009 05:14 AM
eBook Library Windows version DaleDe Sony Reader 0 09-11-2009 06:41 PM


All times are GMT -4. The time now is 05:16 AM.


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