![]() |
#1 |
Junior Member
![]() 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! |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
you need to upgrade
cssutils to atleast 0.9.7a3 |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() 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! |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
post the full error message
|
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() 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)" |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
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 |
![]() |
![]() |
![]() |
#8 |
Junior Member
![]() 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! |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
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" |
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2010
Device: iPad
|
I ran that and got:
UTF-8 UTF-8 |
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
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? |
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,341
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
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. |
![]() |
![]() |
![]() |
#13 |
Junior Member
![]() 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!! |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Windows 7 New Calibre Version problem | Pandzilla | Calibre | 8 | 10-03-2010 02:15 PM |
EPUB generated by ebook-convert does not open gracefully on windows | Heritage History | Calibre | 4 | 07-08-2010 01:37 PM |
Freda ebook software for Windows Mobile release version 1. | pilotbob | News | 5 | 12-13-2009 09:32 AM |
New version of eBook Library for Windows | mwheinz | Sony Reader | 8 | 11-14-2009 04:14 AM |
eBook Library Windows version | DaleDe | Sony Reader | 0 | 09-11-2009 05:41 PM |