View Single Post
Old 10-19-2013, 11:44 PM   #12
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: 45,452
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
And I think I figured out why you were getting the restore failure even though your library path was shorter than 89 chars. The restore process creates a temporary library, I'm guessing that the path to the temp folder was longer than 89 chars on your system. IIRC this can happen if your username is very long as the temp folder is typically, some thing like

C:\Users\username\AppData\Local\Temp\calibre_XXXXX X\XXXXXX_library_restore

which is already 75 characters.

I have shortened that path to
C:\Users\username\AppData\Local\Temp\calibre_XXXXX X\XXXXXX_rlib

which saves 11 characters

EDIT: I've further changed the code to first try to create the temp library in the parent folder of the library you are tring to restore, and only if that fails, to use the temporary directory. That should make it much more robust.

Last edited by kovidgoyal; 10-20-2013 at 12:12 AM.
kovidgoyal is offline   Reply With Quote