Re: [Python-Dev] os.path.diff(path1, path2)
Greg Ewing wrote:
Matthias Andreas Benkard wrote:
/home -> usr/home /usr /usr/home
What does os.path.diff("/home/", "/usr/") yield? "../usr/", I would presume? But that's obviously wrong:
IMO, the relpath method should just work textually on the pathnames. It's up to the user to ensure it makes sense to do so, e.g. by resolving symlinks beforehand if necessary.
In addition, I would presume that relpath would just return the absolute path if passed an absolute path as the second parameter. So the above would simply return "/usr/" IMO. Tim Delaney
Delaney, Timothy (Tim) wrote:
In addition, I would presume that relpath would just return the absolute path if passed an absolute path as the second parameter.
I don't think so. Wouldn't you expect the result of relpath("/usr/local/foo/bax/grump.c", "/usr/local/flump/grump.c") to be "../../flump/grump.c" rather than "/usr/local/flump/grump.c"?
So the above would simply return "/usr/" IMO.
Tim Delaney _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/greg.ewing%40canterbury.ac...
-- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg.ewing@canterbury.ac.nz +--------------------------------------+
participants (2)
-
Delaney, Timothy (Tim) -
Greg Ewing