diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-12-12 04:41:09 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-12-12 04:41:09 +0100 |
commit | 4ea14a0417497be92293cf56c9e8b01cd6d9a23d (patch) | |
tree | c2f98b543e06e1f22670bdcd640cbb6904fc28a8 | |
parent | b8c7660b575476f6ff659de4561331f91235087e (diff) | |
download | python-fastimport-4ea14a0417497be92293cf56c9e8b01cd6d9a23d.tar.gz |
Check for leading slashes in paths, invalid path types.
-rw-r--r-- | fastimport/commands.py | 4 |
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 |