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 08-03-2008, 09:44 PM   #1
Gfinch
Junky
Gfinch is on a distinguished road
 
Gfinch's Avatar
 
Posts: 29
Karma: 58
Join Date: Jul 2008
Location: Denton, Tx
Device: Sony PRS-505 and REB-1100
lit conversion error

It's me again. I get this error when conerting a .lit file to .lrf

('TypeError', u"'NoneType' object is unsubscriptable"):
Failed to perform job: Convert book:C:/Documents and Settings/Glenn Finch/My Documents/My E-Books/Brust, Steven - Vlad Taltos 02 - Yendi.lit
Detailed traceback:
Traceback (most recent call last):
File "parallel.py", line 755, in worker
File "parallel.py", line 724, in work
File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\any\c onvert_from.py", line 167, in main
File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\any\c onvert_from.py", line 137, in process_file
File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\lit\c onvert_from.py", line 72, in process_file
File "C:\Program Files\calibre\library.zip\calibre\ebooks\metadata\ opf.py", line 402, in __init__
File "C:\Program Files\calibre\library.zip\calibre\ebooks\metadata\ opf.py", line 129, in from_opf_spine_element
File "C:\Program Files\calibre\library.zip\calibre\ebooks\metadata\ opf.py", line 119, in __init__
File "calibre\ebooks\metadata\__init__.pyo", line 56, in __init__
File "ntpath.pyo", line 53, in isabs
File "ntpath.pyo", line 119, in splitdrive
TypeError: 'NoneType' object is unsubscriptable
Log:
[DEBUG] convert_from.py:46: ['clit', u'c:\\docume~1\\glennf~1\\locals~1\\temp\\calibre_ 0.4.80_cq-cxk.lit', 'c:\\docume~1\\glennf~1\\locals~1\\temp\\calibre_x y59v-\\']
[INFO] convert_from.py:50:


As alway thanks in advance.
Gfinch is offline   Reply With Quote
Old 08-03-2008, 10:35 PM   #2
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Gfinch View Post
It's me again. I get this error when conerting a .lit file to .lrf
This is fixed in trunk and should work in the next release.
llasram is offline   Reply With Quote
Old 08-03-2008, 10:42 PM   #3
shousa
Groupie
shousa doesn't littershousa doesn't littershousa doesn't litter
 
Posts: 181
Karma: 232
Join Date: May 2006
This may have nothing to do with your .LIT conversion error but it may prove useful. https://wiki.mobileread.com/wiki/Fix_Lit
shousa is offline   Reply With Quote
Old 08-03-2008, 11:28 PM   #4
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by shousa View Post
This may have nothing to do with your .LIT conversion error but it may prove useful. https://wiki.mobileread.com/wiki/Fix_Lit
I'd seen that before but hadn't actually understood what the author was getting at. Looking at it again, I realize it's the hyperlink file-mapping bug in ConvertLIT. This is fixed in calibre when using the calibre-native LIT-extraction code, and I've updated the wiki to reflect this fact.
llasram is offline   Reply With Quote
Old 08-04-2008, 12:57 AM   #5
shousa
Groupie
shousa doesn't littershousa doesn't littershousa doesn't litter
 
Posts: 181
Karma: 232
Join Date: May 2006
Quote:
Originally Posted by llasram View Post
I'd seen that before but hadn't actually understood what the author was getting at. Looking at it again, I realize it's the hyperlink file-mapping bug in ConvertLIT. This is fixed in calibre when using the calibre-native LIT-extraction code, and I've updated the wiki to reflect this fact.
I was the author of that article...some time ago now. Note I use capitalization not as shouting but for explanation (same as in the wiki)

These issues are not the same, IMHO.

First off a basic explanation of the two issues -
ConvertLIT has a bug which will cause references to files sharing a common filename prefix to all refer to the shortest-named so-prefixed file. My fix has nothing to do with fixing this error (which is a somewhat similar error that I have not encountered) but only to fix NOTES links where after conversion you would find all your notes links would bring you back to the Table of Contents page rather than to the note you wanted to read.

Because in my ebooks CHAPTER links work in the exploded .LITs if browsing as webpages and only the NOTES links do not work.

All NOTES links were pointing to, one example, 20002285toc.html (table of contents)
rather than the main text 20002285.html.

In this case the longer file name was being pointed to not the shorter (in your case you are talking about referring to a shorter file name only). Further, in my cases this was always the table of contents which was always a small .html.

In my wiki article "smallest" meant .html file size not filename length.

My fix seems to be unrelated to works of fiction and only occurs in non-fiction books that have a large number (several hundred) of NOTES links (as fiction books generally do not have hundreds of links).

In your case I guess you would also be talking about Chapter links, in my cases these were perfect.

What do you think?

Last edited by shousa; 08-04-2008 at 01:31 AM.
shousa is offline   Reply With Quote
Old 08-04-2008, 01:55 AM   #6
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by shousa View Post
What do you think?
No, they are the same. I just got myself backwards when thinking about what was causing the bug and put "shortest" when "a longer" was correct. This most commonly shows up with footnotes because you'll have files like note1.html, note2.html, ..., note44.html. ConvertLIT internally has a list of filename IDs which are usually the filename without the extension (note1, ..., note44). To fix-up the link it searches through this list, but does so in a way which doesn't distinguish between a full match and an initial substring match. So if it's looking for 'note1' and it finds 'note14' first, then it'll link to 'note14.html' instead of 'note1.html'.

Sorry for the confusion, but the good news is that in the future you can use calibre with 'lit2oeb' and not need fix things up by hand . If you try 'lit2oeb' and footnote links still aren't correct, please file a bug on the calibre trac so that it can be fixed.

Hope this helps,

-Marshall
llasram is offline   Reply With Quote
Old 08-04-2008, 03:53 AM   #7
shousa
Groupie
shousa doesn't littershousa doesn't littershousa doesn't litter
 
Posts: 181
Karma: 232
Join Date: May 2006
Quote:
Originally Posted by llasram View Post
No, they are the same. I just got myself backwards when thinking about what was causing the bug and put "shortest" when "a longer" was correct. This most commonly shows up with footnotes because you'll have files like note1.html, note2.html, ..., note44.html. ConvertLIT internally has a list of filename IDs which are usually the filename without the extension (note1, ..., note44). To fix-up the link it searches through this list, but does so in a way which doesn't distinguish between a full match and an initial substring match. So if it's looking for 'note1' and it finds 'note14' first, then it'll link to 'note14.html' instead of 'note1.html'.

Sorry for the confusion, but the good news is that in the future you can use calibre with 'lit2oeb' and not need fix things up by hand . If you try 'lit2oeb' and footnote links still aren't correct, please file a bug on the calibre trac so that it can be fixed.

Hope this helps,

-Marshall
Thanks for your effort, you are the first person to really discuss this issue with me. I think you are more knowledgeable than me by a long way how Calibre works.

However I did not have any notes links having the error you describe - the ebooks in question did not have footnotes but just a number after a sentence and then at the end of a chapter a list of note numbers each with the associated note text. There are no notes in the Table of contents pages which is what each note was linking to.

So in my case everything about the link was correct, if note 14 it was note 14 never note 1. Only problem was it was searching in the Table of Conents page which had no note links at all.

Could your problem be fixed by the same find and replace method that fixes mine?

Note that it wasn't the longest or shortest filename that defined the error - just that it pointed to the table of contents.html

Do you still think it is the same?

Last edited by shousa; 08-04-2008 at 04:58 AM.
shousa is offline   Reply With Quote
Old 08-04-2008, 05:11 AM   #8
shousa
Groupie
shousa doesn't littershousa doesn't littershousa doesn't litter
 
Posts: 181
Karma: 232
Join Date: May 2006
I have edited the wiki to reflect my understanding of these 2 issues, as I see them.

I have included your text and as a whole it now seems to make sense.

I had put in smallest and biggest to make it easier for newbies to use but on reflection I think it made it much harder....silly me.

If you still think I am wrong lets keep the discussion going and work it out.

Have made my explanation much more user friendly. I hope.

Last edited by shousa; 08-04-2008 at 05:29 AM.
shousa is offline   Reply With Quote
Old 08-04-2008, 05:27 AM   #9
shousa
Groupie
shousa doesn't littershousa doesn't littershousa doesn't litter
 
Posts: 181
Karma: 232
Join Date: May 2006
I have edited the wiki to reflect my understanding of these 2 issues, as I see them.

Please feel free to change to reflect your understanding so we can nut this out.

Here is the "top" of the wiki:

There seem to be two issues when converting a .LIT Microsoft Reader file that occur with links embedded in an ebook for footnotes (bottom of each page) or other notes (end of each chapter).

If your notes links do not work the deciding factors of which issue it is seems to be the following:

* (1) The incorrectly-mapped hyperlink bug - notes links will be "randomly" incorrect. Occurs with ebooks with many notes files. eg note1.html, note2.html...etc

* (2) The all notes hyperlinks point to the table of contents bug - notes links will all point to the table of contents.html even though there are no notes in there.

Occurs with ebooks which have many notes in the main ebook's .html not as separate files.
shousa is offline   Reply With Quote
Old 08-04-2008, 09:26 AM   #10
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by shousa View Post
Please feel free to change to reflect your understanding so we can nut this out.
I'm still pretty sure the issues are the same... Hmm. Could you do me a favor and try extracting one of your books with this problem using 'lit2oeb' from the most recent version of calibre? If it extracts your file without the problem you noticed before, then the issues identical. Thanks in advance !
llasram is offline   Reply With Quote
Old 08-04-2008, 08:31 PM   #11
shousa
Groupie
shousa doesn't littershousa doesn't littershousa doesn't litter
 
Posts: 181
Karma: 232
Join Date: May 2006
Sure, I'll give it a go.

Thanks for pointing out the possible fix - btw I only updated to Calibre just the other day and have not yet converted any ebooks with it.
shousa is offline   Reply With Quote
Old 08-04-2008, 09:28 PM   #12
shousa
Groupie
shousa doesn't littershousa doesn't littershousa doesn't litter
 
Posts: 181
Karma: 232
Join Date: May 2006
Tried it and you were right it worked. Good job by you to pick that.

This means Calibre solves both issues.

It seems instead of 2 errors it was 1 error (incorrect hyperlinks) that had 2 different outcomes depending upon whether the ebook had the notes internally in the main.html or as individual notes.html (eg note1.html, note2.html etc).

Updated wiki to reflect.

Kovid never rests on his laurels does he!
shousa is offline   Reply With Quote
Old 08-04-2008, 09:36 PM   #13
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: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This fix is entirely llasram's doing.
kovidgoyal is offline   Reply With Quote
Old 08-06-2008, 03:13 AM   #14
shousa
Groupie
shousa doesn't littershousa doesn't littershousa doesn't litter
 
Posts: 181
Karma: 232
Join Date: May 2006
Thanks to llasram!
shousa 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
conversion error rheostaticsfan Calibre 2 09-16-2010 04:01 PM
Conversion Error ? JDługosz Calibre 4 07-04-2010 12:45 PM
Book Error In Sigil After Calibre Conversion (from lit to epub) Guns4Hire Sigil 13 03-05-2010 05:02 PM
Conversion Error athena416 Calibre 0 10-04-2009 02:45 AM
Error: Conversion Error Spectralist Calibre 1 08-08-2009 12:14 PM


All times are GMT -4. The time now is 06:51 AM.


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