Basically, cicp_canonical_relpath always assumed that 'abspath()' returned a path that did not have a trailing '/'. However, when working at the root of the filesytem, this was not true. (And, I believe, not true on Linux or Mac, either.)
So I changed:
return current[len(abspath+1):]
to
return current[len(abspath):].lstrip('/')
which seems to work just fine.
In the process of doing this, I also made the function handle when base doesn't actually exist, since it made testing easier. And I changed it to always run tests that I'm sure will pass. (We don't require the filesystem to have CICP to run _cicp_canonical_relpath, only if we wanted to call it by 'osutils.canonical_relpath()'. This should help increase PQM test coverage.)
This fixes bug #322807
Basically, cicp_canonical_ relpath always assumed that 'abspath()' returned a path that did not have a trailing '/'. However, when working at the root of the filesytem, this was not true. (And, I believe, not true on Linux or Mac, either.)
So I changed: len(abspath+ 1):] len(abspath) :].lstrip( '/')
return current[
to
return current[
which seems to work just fine.
In the process of doing this, I also made the function handle when base doesn't actually exist, since it made testing easier. And I changed it to always run tests that I'm sure will pass. (We don't require the filesystem to have CICP to run _cicp_canonical _relpath, only if we wanted to call it by 'osutils. canonical_ relpath( )'. This should help increase PQM test coverage.)