View Single Post
Old 04-23-2022, 11:00 AM   #1627
chaley
Grand Sorcerer
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: 12,488
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
@lomkiri: the log you provided shows that the key to the name_path_map dict on Linux is the full path. On windows, the key is the relative name.

On windows:
Code:
root: C:\Users\Charles\AppData\Local\Temp\calibre_b79oq7bw\4vvfit2c_modify-epub
[...]
dirpath: C:\Users\Charles\AppData\Local\Temp\calibre_b79oq7bw\4vvfit2c_modify-epub\Ops
filename: 1.html
path:C:\Users\Charles\AppData\Local\Temp\calibre_b79oq7bw\4vvfit2c_modify-epub\Ops\1.html
name: Ops/1.html
This implies that os.path.relpath() (around line 103) is producing different answers depending on the system. On windows it is the relative path. On linux it is the full path.

I wonder why the code is written using relpath(). The root path should always be a prefix of the file path. I will try that. If it works on windows then I will post another test version.

EDIT: See later post. I am reasonably sure the path was changed somewhere else just before the ncx was checked.

Last edited by chaley; 04-23-2022 at 11:32 AM.
chaley is offline   Reply With Quote