Nick Coghlan <ncogh...@gmail.com> added the comment: A new function sounds like a good solution to me. How about just calling it "os.path.commonpath" though?
I agree having a path component based prefix function in os.path is highly desirable, particularly since the addition of relpath in 2.6: base_dir = os.path.commonpath(paths) rel_paths = [os.path.relpath(p, base_dir) for p in paths] ---------- nosy: +ncoghlan _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4755> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com