From: James Bunton Date: Fri, 1 Jul 2011 13:37:39 +0000 (+1000) Subject: Don't sync to folders that don't exist X-Git-Url: https://code.delx.au/notipod/commitdiff_plain/63ea306c18fa36af8d82c0ef60c8bad864418e81 Don't sync to folders that don't exist --- diff --git a/libnotipod.py b/libnotipod.py index 3e30e4d..7f1a6b0 100644 --- a/libnotipod.py +++ b/libnotipod.py @@ -197,6 +197,8 @@ def sync(dry_run, source, dest, files_to_copy): filemap[sf.encoded_filename.lower()] = sf files_to_copy = set(filemap) + if not os.path.isdir(dest): + raise OSError("No such file or directory: '%s'" % dest) for dirpath, dirnames, filenames in os.walk(dest): full_dirpath = dirpath dirpath = strip_prefix(dirpath, dest)