dvc: progress, prompt: isatty broken on Windows, default git bash and conda python

Effectively it means that we don’t see any progress bars. Just empty screen for commands.

It’s a well known issue on a default setup - conda + git bash (haven’t tested other configurations). More on this here: https://stackoverflow.com/a/32599341/298182

To reproduce:

import sys

file = sys.stderr
print(file.isatty())

returns False if you run like this python test.py returns True if winpty python test.py

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 23 (23 by maintainers)

Commits related to this issue

Most upvoted comments

@efiop @shcheklein Do you or anyone else have easy access to a Windows machine to see the status of this issue?

Lowering to p2 for now.

As a quick follow-up - it’s not a good idea to check env vars for detecting if running in git-bash because we still want to disable if really redirecting to a file.

unfortunately rprichard/winpty isn’t exactly a small fix which could be integrated into dvc core. May have to rely on detecting MSYS/Cygwin/git-bash from os.environ and doing something special accordingly.

Would also need to ensure the “something special” (e.g. reduce progress updates to once per 2 seconds to prevent console spamming, or maybe disable progress altogether, or add a single . each iteration, etc…) isn’t done when using winpty

Actually this may just be a colorama issue on windows, which may coincidentally have been fixed by my last devel-branch commit: https://github.com/tqdm/tqdm/commit/ae6de71c3460123944aa7bb80d7cb0b5bdcafb7b

@efiop / @shcheklein could you try

pip install -U git+https://github.com/tqdm/tqdm.git@ae6de71c#egg=tqdm

and check if it fixes this issue?

@shcheklein @efiop DVC_IGNORE_ISATTY=true also skips checking isatty so there must be something else going on

@casperdcl may be it does not check isatty at all?

Ah interesting… conda uses tqdm so there must be a way to patch it.