★ wanayoo — archive 1999 https://github.com/dbcli/pgcli/issues/327Nouvelle recherche | Portail wanayoo
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

pgcli crashes when PAGER is an empty string. #327

Closed
jonathanslenders opened this issue Aug 8, 2015 · 2 comments
Closed

pgcli crashes when PAGER is an empty string. #327

jonathanslenders opened this issue Aug 8, 2015 · 2 comments

Comments

@jonathanslenders
Copy link
Contributor

@jonathanslenders jonathanslenders commented Aug 8, 2015

jonathan @ arch-jonathan [master] ~/git/pgcli
[pt] > PAGER= pgcli --user postgres
Traceback (most recent call last):
  File "/home/jonathan/env/pt/bin/pgcli", line 9, in <module>
    load_entry_point('pgcli==0.19.0', 'console_scripts', 'pgcli')()
  File "/home/jonathan/env/pt/lib/python3.4/site-packages/click-4.1-py3.4.egg/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/home/jonathan/env/pt/lib/python3.4/site-packages/click-4.1-py3.4.egg/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/home/jonathan/env/pt/lib/python3.4/site-packages/click-4.1-py3.4.egg/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jonathan/env/pt/lib/python3.4/site-packages/click-4.1-py3.4.egg/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "/home/jonathan/git/pgcli/pgcli/main.py", line 461, in cli
    pgcli.run_cli()
  File "/home/jonathan/git/pgcli/pgcli/main.py", line 353, in run_cli
    click.echo_via_pager('\n'.join(output))
  File "/home/jonathan/env/pt/lib/python3.4/site-packages/click-4.1-py3.4.egg/click/termui.py", line 203, in echo_via_pager
    return pager(text + '\n', color)
  File "/home/jonathan/env/pt/lib/python3.4/site-packages/click-4.1-py3.4.egg/click/_termui_impl.py", line 263, in pager
    return _pipepager(text, os.environ['PAGER'], color)
  File "/home/jonathan/env/pt/lib/python3.4/site-packages/click-4.1-py3.4.egg/click/_termui_impl.py", line 292, in _pipepager
    if color is None and cmd_detail[0] == 'less':
IndexError: list index out of range

It's a bug in click. I created an issue there: pallets/click#403
Just make sure to upgrade when that's fixed.

@amjith
Copy link
Member

@amjith amjith commented Aug 9, 2015

Looks like it's fixed in click. But they don't release often. So I'll keep an eye on it and bump the minimum version when it is released. Thanks!

@amjith amjith added the Easy label Sep 21, 2016
@j-bennet
Copy link
Contributor

@j-bennet j-bennet commented Nov 6, 2016

This was released in 5.0: pallets/click@349875d.

@amjith amjith closed this Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.