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.
|