View Single Post
Old 03-03-2018, 01:47 PM   #218
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,034
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
The reference 'OEBPS/../toc.ncx' contains a superfluous path--it's the same as just 'toc.ncx'. And apparently Python's ZipFile class doesn't like that.

Fixing that particular problem isn't difficult, but it represents an entire class of problems with allowed paths: "asdf/../asdf" "asdf//asdf" "asdf/./asdf" and variations there on. Using the builtin Python method for this (os.path.normpath()) isn't directly practical because on windows it changes the '/'s to '\'s. Or '\\' in my tests, which ZipFile also doesn't like.

I'm trying to decide how much of this I want to address and how. Clearly it's not a common problem, since this is the first time it's come up in 5+ years.

In the meantime, you could edit your epub, open the content.opf file and remove "OEBPS/../". Then EpubSplit should work on it.
JimmXinu is online now   Reply With Quote