Dare I say it? If you need modules anyway, why not existing utilities instead? What about using tar jcf directory.tar.bz2 directory/
on linux or 7zip on Windows to back up your files? Or is it that the solution has to be in portable code?
Update: My apologies: this won't work for linux, because tar also crashes when encountering the missing files it was given as input.