Closed LilyFoote closed 10 years ago
The split_path function in conman.nav_tree.utils splits a url path into sub-paths. What is the expected behaviour if the given path does not start with '/'? The current behaviour is:
split_path
conman.nav_tree.utils
'/'
>>> split_path('foo/bar/') ['/', 'foo/bar/', 'foo/']
This does not seem useful. Should split_path reject input without a leading '/' or should one be prepended?
Yes, this does seem odd, but it should never be called with that sort of input.
I suppose that we could assert path[0] == '/', but it does seem a little brutish to me.
assert path[0] == '/'
The
split_path
function inconman.nav_tree.utils
splits a url path into sub-paths. What is the expected behaviour if the given path does not start with'/'
? The current behaviour is:This does not seem useful. Should
split_path
reject input without a leading'/'
or should one be prepended?