Check for leading slashes in paths, invalid path types.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 12 Dec 2010 03:41:09 +0000 (04:41 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 12 Dec 2010 03:41:09 +0000 (04:41 +0100)
fastimport/commands.py

index fe2379bfccb9af7825b8f8c3d130b976d53b207b..f3b9541a34f9167b1919da1e9a1a5a68471309be 100644 (file)
@@ -384,8 +384,10 @@ def check_path(path):
     :return: the path if all is OK
     :raise ValueError: if the path is illegal
     """
-    if path is None or path == '':
+    if path is None or path == '' or path[0] == "/":
         raise ValueError("illegal path '%s'" % path)
+    if type(path) != str:
+        raise TypeError("illegale type for path '%r'" % path)
     return path