codecov-python icon indicating copy to clipboard operation
codecov-python copied to clipboard

Colorer characters printed out on windows

Open raczben opened this issue 5 years ago • 3 comments

Here is the output of codecov, where there are some unwanted characters like [90m==>[0m

D:\foo>codecov

      _____          _
     / ____|        | |
    | |     ___   __| | ___  ___ _____   __
    | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
    | |___| (_) | (_| |  __/ (_| (_) \ 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:   [email protected]
  IRC:     #codecov
  Gitter:  https://gitter.im/codecov/support
  Twitter: @codecov

I use:

  • Win 10.0.18363 Build 18363 (both cmd and powershell)
  • Python 3.7.4
  • Codecov py-v2.0.15 - https://codecov.io/

raczben avatar Jan 27 '20 15:01 raczben

A workaround is to use --no-color switch. However this should be solved, codecov should detect the platform.

raczben avatar Jan 28 '20 08:01 raczben

I suggest to use colorama or termcolor or any other handy tool for colored output, instead of the current, platform specific way.

raczben avatar Jan 28 '20 08:01 raczben

Colors work properly in PowerShell command prompt, however it does not work in cmd prompt.

nmoinvaz avatar Dec 02 '20 06:12 nmoinvaz