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

`pip search` doesn't work in narrow terminals #3655

Closed
tinruufu opened this Issue May 5, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@tinruufu
Contributor

tinruufu commented May 5, 2016

  • Pip version: 8.1.1 (also happens in at least 8.1.0)
  • Python version: 2.7.9
  • Operating System: xenial

Description:

pip search can't print results to narrow terminal windows

What I've run:

pip search [something with results] in a 63-column urxvt instance:

Exception:
Traceback (most recent call last):
  File "/home/tinruufu/.virtualenvs/tinruufu/local/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/home/tinruufu/.virtualenvs/tinruufu/local/lib/python2.7/site-packages/pip/commands/search.py", line 50, in run
    print_results(hits, terminal_width=terminal_width)
  File "/home/tinruufu/.virtualenvs/tinruufu/local/lib/python2.7/site-packages/pip/commands/search.py", line 122, in print_results
    terminal_width - name_column_width - 5,
  File "/usr/lib/python2.7/textwrap.py", line 354, in wrap
    return w.wrap(text)
  File "/usr/lib/python2.7/textwrap.py", line 329, in wrap
    return self._wrap_chunks(chunks)
  File "/usr/lib/python2.7/textwrap.py", line 258, in _wrap_chunks
    raise ValueError("invalid width %r (must be > 0)" % self.width)
ValueError: invalid width -14 (must be > 0)
$ tput cols
63

as an aside, it's a bummer that the download progress bars don't get narrow in such windows and instead vomits hundreds of lines of rectangles; progressbar handles this fine. this is the first time i've found something that just straight-up doesn't work at all though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment