Issue #44 invalid

Use os.path functions for manipulating filesystem paths

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/file1.py" and "sub2/file2.py", it will report a common prefix of "sub", leaving supposedly-relative pathnames of "1/file1.py" and "2/file2.py", 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/somelib.py" shouldn't be "libs/somelib.py", because that is not relative to the project directory.

    I've reverted that part of the patch.

  2. Log in to comment