Use os.path functions for manipulating filesystem paths

Issue #44 invalid
Ben Finney created an issue

Several functions in Coverage use string manipulation directly on filesystem paths. This should be done instead using the abstractions provided in the os.path module.

Comments (3)

  1. Ned Batchelder repo owner

    It turns out that os.path.commonprefix is kind of useless.

    First, given "sub1/" and "sub2/", it will report a common prefix of "sub", leaving supposedly-relative pathnames of "1/" and "2/", which are useless as file paths.

    Second, if the current directory is "ned/project", and another file is in "ned/libs", the relative path for "ned/libs/" shouldn't be "libs/", because that is not relative to the project directory.

    I've reverted that part of the patch.

  2. Log in to comment