CERT-Polska / mwdblib

Client library for the mwdb service by CERT Polska.
https://mwdblib.readthedocs.io/en/latest/
MIT License
40 stars 13 forks source link

get_terminal_size #70

Closed xorhex closed 2 years ago

xorhex commented 2 years ago

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 commented 2 years ago

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.