Problem when combining windows generated data on linux machine

Issue #618 resolved
Anonymous created an issue

If i have the following directory structure:

- project/
    - module/
        - tests/
            - file.py

a coveragerc with the folowing paths configuration:

[paths]
source =
    project/module
    */project/module
    *\project\module

The windows data file contains:

!coverage.py: This is a private format, don't read it directly!{"lines":{"C:\\a\\path\\somewhere\\coveragepy_test\\project\\module\\tests\\file.py":[1,2,3,4]}}

When i run, on a Linux machine:

$ coverage combine coverage.win.paths

the resulting coverage data file is:

!coverage.py: This is a private format, don't read it directly!{"lines":{"/tmp/coveragepy_test/project/module/tests\\file.py":[1,2,3,4]}}

I tried many different [paths] configuration with no luck.

I'm uploading a .tar.gz with the same scenario so you only need to do coverage combine coverage.win.paths to see the problem happening.

let me know if I can provide more information.

thanks!

Comments (7)

  1. Bruno Gola

    hi @Ned Batchelder, the problem is that the resulting data file has a wrong path ("/tmp/coveragepy_test/project/module/tests\file.py")

    if you download the .tar file and run (on linux):

    coverage combine coverage.win.path
    

    check the .coverage file.

    there is a .coveragerc in the .tar, i believe the [paths] setting is right.

    thanks for the reply

  2. Ned Batchelder repo owner

    OK, I finally understand: the specific wrong thing is the backslash in the path, since it should be a Linux path. Interestingly, if you swap the last two lines in your [paths] configuration, it works, though it might not then on Windows. I'm looking into it.

  3. Log in to comment