2

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.

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
betontalpfa
  • 3,454
  • 1
  • 33
  • 65
  • Here is an appveyor example: https://ci.appveyor.com/project/raczben/wexpect/builds/30382641#L262 – betontalpfa Jan 27 '20 at 15:52
  • The single quotes around the path in `cd 'D:\foo'` are invalid syntax in CMD. It only supports double quotes for normal quoting. (Single quotes have a special use in a `for /f` loop statement.) CMD will end up trying to resolve the name relative to the working directory, e.g. `D:\foo\'D:\ `. I don't know why it doesn't end up as `D:\foo\'D:\foo'`, but in any case it isn't a valid file path. – Eryk Sun Jan 28 '20 at 03:00

1 Answers1

1

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

betontalpfa
  • 3,454
  • 1
  • 33
  • 65