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

get_terminal_size #70

Closed
xorhex opened this issue Mar 30, 2022 · 1 comment · Fixed by #71
Closed

get_terminal_size #70

xorhex opened this issue Mar 30, 2022 · 1 comment · Fixed by #71
Labels
bug Something isn't working

Comments

@xorhex
Copy link

xorhex commented Mar 30, 2022

Getting this error when running a query using the mwdb cli tool:

  File "/home/name/venv_mwdb/lib/python3.9/site-packages/mwdblib/cli/formatters/tabular.py", line 34, in format_table
    term_width, term_height = click.get_terminal_size()
AttributeError: module 'click' has no attribute 'get_terminal_size'

Should this be os.get_terminal_size() instead of click.get_terminal_size()? https://github.com/CERT-Polska/mwdblib/blob/master/mwdblib/cli/formatters/tabular.py#L20

@psrok1 psrok1 added the bug Something isn't working label Mar 31, 2022
@psrok1
Copy link
Member

psrok1 commented Mar 31, 2022

Agree, get_terminal_size looks to be dropped from click 8.0.0 (https://click.palletsprojects.com/en/8.1.x/changes/#version-8-0-0)
image

So shutil.get_terminal_size should be used instead (https://docs.python.org/3/library/shutil.html#shutil.get_terminal_size). Temporary workaround is to install click 7.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants