Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Terminal control codes being output even with "-q" (as of 8.0.0) #3418
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!)
Going to assume it's all in here: https://github.com/pypa/pip/blob/master/pip/_vendor/progress/helpers.py :)
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 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 :-)