From 4bfb5b92f8a0546cfb3185be3c2acf6026ef9e93 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Fri, 27 Apr 2012 03:54:55 +0200 Subject: [PATCH] Added check for nonexistent directories in tar-mode --- servefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/servefile b/servefile index 0c3fa31..19c8868 100755 --- a/servefile +++ b/servefile @@ -540,6 +540,8 @@ class ServeFile(): raise ServeFileException("Error: Could not open file!") handler = FileHandler elif self.serveMode == self.MODE_SINGLETAR: + if not os.path.exists(self.target): + raise ServeFileException("Error: Could not open file or directory") TarFileHandler.target = self.target TarFileHandler.fileName = os.path.basename(self.target.rstrip("/"))