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 --list produces error when postgres server is running. #951

Open
mario-grgic opened this Issue Oct 1, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@mario-grgic

mario-grgic commented Oct 1, 2018

Description

Simply issuing pgcli --list, leads to

$ pgcli --list
Traceback (most recent call last):
  File "/usr/local/bin/pgcli", line 11, in <module>
    sys.exit(cli())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pgcli/main.py", line 1045, in cli
    pgcli.echo_via_pager('\n'.join(formatted))
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pgcli/main.py", line 919, in echo_via_pager
    if len(lines) >= self.prompt_app.output.get_size().rows - 4 or any(self.is_wide_line(l) for l in lines):
AttributeError: 'NoneType' object has no attribute 'output'

This only happens if postgres server is running. Otherwise, normal error that connection could not be established is printed.

Your environment

  • Please provide your OS and version information.

macOS 10.14 Mojave, Python 3.7.0

$ hostinfo
Mach kernel version:
	 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64
Kernel configured for up to 4 processors.
4 processors are physically available.
4 processors are logically available.
Processor type: x86_64h (Intel x86-64h Haswell)
Processors active: 0 1 2 3
Primary memory available: 32.00 gigabytes
Default processor set: 335 tasks, 1079 threads, 4 processors
Load average: 0.77, Mach factor: 3.22
$
$ python3 --version
Python 3.7.0
$
  • Please provide your CLI version.
$ pgcli --version
Version: 2.0.0
$
  • What is the output of pip freeze command.
$ pip3 freeze
alabaster==0.7.11
altgraph==0.16.1
aniso8601==3.0.2
appnope==0.1.0
asn1crypto==0.24.0
astroid==2.0.4
attrs==18.2.0
autopep8==1.4
Babel==2.6.0
backcall==0.1.0
beautifulsoup4==4.6.3
bleach==2.1.4
blinker==1.4
bottle==0.12.13
brewer2mpl==1.4.1
brotlipy==0.7.0
certifi==2018.8.24
cffi==1.11.5
chardet==3.0.4
cli-helpers==1.0.2
click==6.7
cloudpickle==0.5.5
configobj==5.0.6
cryptography==2.3.1
cssselect==1.0.3
cycler==0.10.0
Cython==0.28.5
dask==0.19.0
decorator==4.3.0
Distance==0.1.3
Django==2.1.2
docopt==0.6.2
docutils==0.14
entrypoints==0.2.3
fake-factory==9999.9.9
flake8==3.5.0
Flask==1.0.2
graphene==2.1.3
graphql-core==2.1
graphql-relay==0.4.5
h11==0.7.0
h2==3.0.1
hpack==3.0.0
html5lib==1.0.1
httpie==0.9.9
humanize==0.5.1
hyperframe==5.1.0
idna==2.7
imagesize==1.1.0
ipdb==0.11
ipykernel==4.9.0
ipyparallel==6.2.2
ipython==7.0.1
ipython-genutils==0.2.0
ipywidgets==7.4.1
iso8601==0.1.12
isodate==0.6.0
itsdangerous==0.24
jedi==0.12.1
Jinja2==2.10
jsonschema==2.6.0
jupyter-client==5.2.3
jupyter-core==4.4.0
kaitaistruct==0.8
keyring==13.2.1
kiwisolver==1.0.1
lazy-object-proxy==1.3.1
ldap3==2.5.1
lxml==4.2.5
MarkupSafe==1.0
matplotlib==3.0.0
mccabe==0.6.1
mistune==0.8.3
mitmproxy==4.0.4
modulegraph==0.17
mpmath==1.0.0
nbconvert==5.3.1
nbformat==4.4.0
networkx==2.2
nltk==3.3
nose==1.3.7
notebook==5.6.0
numpy==1.15.2
oauthlib==2.1.0
ortools==6.9.5824
packaging==17.1
pandas==0.23.4
pandocfilters==1.4.2
parso==0.3.1
passlib==1.7.1
patsy==0.5.0
pdfkit==0.6.1
pdfrw==0.4
pep8==1.7.1
pexpect==4.6.0
pgcli==2.0.0
pgspecial==1.11.2
pickleshare==0.7.4
Pillow==5.3.0
praw==6.0.0
prawcore==1.0.0
prometheus-client==0.3.1
promise==2.1
prompt-toolkit==2.0.4
protobuf==3.6.1
psycopg2==2.7.5
ptyprocess==0.6.0
pyasn1==0.4.4
pycodestyle==2.3.1
pycparser==2.18
pycrypto==2.6.1
pyflakes==1.6.0
Pygments==2.2.0
pyOpenSSL==18.0.0
pyparsing==2.2.0
pyperclip==1.6.4
pyquery==1.4.0
python-dateutil==2.7.3
python-igraph==0.7.1.post6
pytz==2018.5
PyWavelets==1.0.0
pyzmq==17.1.2
qtconsole==4.4.1
rdflib==4.2.2
requests==2.19.1
requests-oauthlib==1.0.0
ruamel.yaml==0.15.64
Rx==1.6.1
scikit-image==0.14.0
scikit-learn==0.20.0
scipy==1.1.0
Send2Trash==1.5.0
setproctitle==1.1.10
sh==1.12.14
simplegeneric==0.8.1
six==1.11.0
snowballstemmer==1.2.1
sortedcontainers==2.0.4
speedtest-cli==2.0.2
Sphinx==1.8.1
sphinxcontrib-websupport==1.1.0
sqlparse==0.2.4
statsmodels==0.9.0
sympy==1.3
tabulate==0.8.2
terminado==0.8.1
terminaltables==3.1.0
testpath==0.3.1
Theano==1.0.3
toolz==0.9.0
tornado==5.1.1
tqdm==4.26.0
traitlets==4.3.2
typed-ast==1.1.0
typing==3.6.6
update-checker==0.16
urllib3==1.23
urwid==2.0.1
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.14.1
widgetsnbextension==3.4.1
wrapt==1.10.11
wsproto==0.11.0
$

@j-bennet j-bennet added bug easy labels Oct 1, 2018

@j-bennet j-bennet referenced this issue Oct 2, 2018

Merged

Fix for pgcli --list. #952

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