pythonwindowscode-coveragecodecov

How to fix error “The filename, directory name, or volume label syntax is incorrect”?


I use codecov in a python project on Windows, but when I try to upload coverage report to codecove server I get the following error:

The filename, directory name, or volume label syntax is incorrect.

D:\foo>codecov -t ***

      _____          _
     / ____|        | |
    | |     ___   __| | ___  ___ _____   __
    | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
    | |___| (_) | (_| |  __/ (_| (_) \ V /
     \_____\___/ \____|\___|\___\___/ \_/
                                    v2.0.15

[90m==>[0m Detecting CI provider
  -> Got branch from git/hg
  -> Got sha from git/hg
[90m==>[0m Preparing upload
The filename, directory name, or volume label syntax is incorrect.
    Error running `cd 'D:\foo' && git ls-files`: None
[41mError:[0m[91m Missing repository upload token[0m

[42mTip:[0m[32m See all example repositories: https://github.com/codecov?query=example[0m
[92mSupport channels:[0m
  Email:   hello@codecov.io
  IRC:     #codecov
  Gitter:  https://gitter.im/codecov/support
  Twitter: @codecov

HOWEVER

If I run the codecov form WSL (Linux) (from the same repo, with the same reports), everything is fine.


UPDATE

codecov 2.0.10 can upload successfully, from 2.0.11 I get this The filename, directory name, or volume label syntax is incorrect. error.


Solution

  • Give the coverage report file (coverage.xml by default) using the --file switch. In this case codecov wont search for files and wont crash.

    codecov --no-color -X gcov --file coverage.xml

    (I suggest to disable coloring with --no-color and gcov -X gcov, to reduce unwanted errors.)

    UPDATE

    There is a fix for this issue: https://github.com/codecov/codecov-python/issues/167