summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-12-12 04:41:09 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-12-12 04:41:09 +0100
commit4ea14a0417497be92293cf56c9e8b01cd6d9a23d (patch)
treec2f98b543e06e1f22670bdcd640cbb6904fc28a8
parentb8c7660b575476f6ff659de4561331f91235087e (diff)
downloadpython-fastimport-4ea14a0417497be92293cf56c9e8b01cd6d9a23d.tar.gz
Check for leading slashes in paths, invalid path types.
-rw-r--r--fastimport/commands.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/fastimport/commands.py b/fastimport/commands.py
index fe2379b..f3b9541 100644
--- a/fastimport/commands.py
+++ b/fastimport/commands.py
@@ -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