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

tianon 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 in docker-library/python Jan 22, 2016

Merged

pip 8.0 #83

@mattrobenolt

This comment has been minimized.

Show comment
Hide comment
@mattrobenolt

mattrobenolt Jan 22, 2016

Contributor

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

Contributor

mattrobenolt 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.

Show comment
Hide comment

@xavfernandez xavfernandez added the T: bug label Jan 26, 2016

@xavfernandez

This comment has been minimized.

Show comment
Hide comment
@xavfernandez

xavfernandez Jan 26, 2016

Contributor

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

cc @njsmith if you have any idea :)

Contributor

xavfernandez 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.

Show comment
Hide comment
@njsmith

njsmith Jan 26, 2016

Member

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 :-)

Member

njsmith 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.

Show comment
Hide comment
@frewsxcv

frewsxcv 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

frewsxcv 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 gh-3418
@njsmith

This comment has been minimized.

Show comment
Hide comment
@njsmith

njsmith Feb 1, 2016

Member

Submitted a PR.

Member

njsmith 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 gh-3418

@xavfernandez xavfernandez closed this in #3444 Feb 2, 2016

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 gh-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