We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dvc status --json: not parsable due to color escape codes
Expectation is that --json produces json-compatible output. This is not the case, due to ANSI escape codes that lead to invalid json.
(No escape codes) {}
I expect to be able to pipe the output of a --json command into 'jq' without json formatting errors
Output of dvc doctor:
dvc doctor
$ dvc doctor DVC version: 3.50.2 (deb) ------------------------- Platform: Python 3.10.8 on Linux-4.18.0-425.10.1.el8_7.x86_64-x86_64-with-glibc2.31 Subprojects: Supports: azure (adlfs = 2024.4.1, knack = 0.11.0, azure-identity = 1.16.0), gdrive (pydrive2 = 1.19.0), gs (gcsfs = 2024.3.1), hdfs (fsspec = 2024.3.1, pyarrow = 16.0.0), http (aiohttp = 3.9.5, aiohttp-retry = 2.8.3), https (aiohttp = 3.9.5, aiohttp-retry = 2.8.3), oss (ossfs = 2023.12.0), s3 (s3fs = 2024.3.1, boto3 = 1.34.69), ssh (sshfs = 2024.4.1), webdav (webdav4 = 0.9.8), webdavs (webdav4 = 0.9.8), webhdfs (fsspec = 2024.3.1) Config: Global: /root/.config/dvc System: /etc/xdg/dvc Cache types: <https://error.dvc.org/no-dvc-cache> Caches: local Remotes: None Workspace directory: xfs on /dev/mapper/vg01-lv01 Repo: dvc, git Repo.site_cache_dir: /var/tmp/dvc/repo/113fba86254417b4ef5da622c5281b19
Additional Information (if any):
The text was updated successfully, but these errors were encountered:
I can't reproduce this right away, I think we have some logic that disables colorize:
def setup(level: int = logging.INFO, log_colors: bool = True) -> None: colorama.init() color_out = log_colors and bool(sys.stdout) and sys.stdout.isatty() color_err = log_colors and bool(sys.stderr) and sys.stderr.isatty() ...
from dvc/logger.py
dvc/logger.py
Moreover, -q doesn't produce (expected any results for me).
-q
Is there anything specific about your setup? What terminal are you using?
Sorry, something went wrong.
No branches or pull requests
Bug Report
Issue name
dvc status --json: not parsable due to color escape codes
Description
Expectation is that --json produces json-compatible output. This is not the case, due to ANSI escape codes that lead to invalid json.
Reproduce
(Shows)
^[[1m{^[[0m^[[1m}^[[0m
^[[0m
Expected
(No escape codes)
{}
I expect to be able to pipe the output of a --json command into 'jq' without json formatting errors
Environment information
Output of
dvc doctor
:Additional Information (if any):
The text was updated successfully, but these errors were encountered: