Skip to content
New issue

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

Terminal control codes being output even with "-q" (as of 8.0.0) #3418

Closed
tianon opened this issue Jan 22, 2016 · 6 comments

Comments

Projects
None yet
5 participants
@tianon
Copy link

commented Jan 22, 2016

I think examples of output will illustrate the bug far more clearly than I can describe:

$ pip --version
pip 8.0.2 from /usr/local/lib/python3.5/site-packages (python 3.5)
$ pip install -q sh | hexdump -C
00000000  1b 5b 3f 32 35 6c 1b 5b  3f 32 35 68              |.[?25l.[?25h|
0000000c
$ 

Compare to previous (expected) output:

$  pip --version
pip 7.1.2 from /usr/local/lib/python3.5/site-packages (python 3.5)
$ pip install -q sh | hexdump -C
$ 

It's probably also worth noting that piping the output didn't suppress these either (as might also be expected). 👍

(Happy to provide more detail or do more debugging as desired!)

@tianon tianon referenced this issue Jan 22, 2016

Merged

pip 8.0 #83

@mattrobenolt

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2016

To add to this, I can't reproduce on OSX. It seems to only be on Linux.

@mattrobenolt

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2016

@xavfernandez

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2016

Bisecting lead to 5bb9899 certainly the contextmanager hidden_cursor that always write the control characters.

cc @njsmith if you have any idea :)

@njsmith

This comment has been minimized.

Copy link
Member

commented Jan 26, 2016

Doh, yes, definitely my fault. Ugh. The interaction between the use of the logging system for output + the desire for fancy terminal display is very nasty and error prone...

I guess hidden_cursor's output should be protected by the incantation

if file.isatty() and logger.getEffectiveLevel() <= logging.INFO: ...

I can make a patch containing the above but I don't know how to write a test for it, so I'd appreciate tips on that. Or given how trivial the fix itself is maybe it'd be quicker just to do it yourself, either way :-)

@frewsxcv

This comment has been minimized.

Copy link

commented Feb 1, 2016

Is there anything I can do to help with this? This is preventing everyone (including myself) from using pip 8.x with the Python docker image

njsmith added a commit to njsmith/pip that referenced this issue Feb 1, 2016

Make install --quiet really quiet
Commit 5bb9899 added some code for hiding/showing the cursor when
running on the terminal, but accidentally made it so that it always
printed the invisible control codes, even when not on a tty or when
--quiet was specified. This turns out to be surprisingly bad (e.g. it
breaks the official docker python builds). So, let's not do that.

Fixes pypagh-3418
@njsmith

This comment has been minimized.

Copy link
Member

commented Feb 1, 2016

Submitted a PR.

njsmith added a commit to njsmith/pip that referenced this issue Feb 1, 2016

Make install --quiet really quiet
Commit 5bb9899 added some code for hiding/showing the cursor when
running on the terminal, but accidentally made it so that it always
printed the invisible control codes, even when not on a tty or when
--quiet was specified. This turns out to be surprisingly bad (e.g. it
breaks the official docker python builds). So, let's not do that.

Fixes pypagh-3418

zvezdan added a commit to zvezdan/pip that referenced this issue Feb 21, 2016

Make install --quiet really quiet
Commit 5bb9899 added some code for hiding/showing the cursor when
running on the terminal, but accidentally made it so that it always
printed the invisible control codes, even when not on a tty or when
--quiet was specified. This turns out to be surprisingly bad (e.g. it
breaks the official docker python builds). So, let's not do that.

Fixes pypagh-3418

@xavfernandez xavfernandez added this to the 8.0.3 milestone Feb 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.