Repository navigation
Crash complaining of tabulate() and preserve_whitespace #1699
Description
Activity
Hi! Thanks for the report! Seems like dependency versions is something we should add to
--checkup.If you have the time, could you try these commands?
env PYTHONPATH= mycli -u u -p p --myclirc /usr/lib/python3/dist-packages/mycli/myclirc db
(and verify you have the same bug)
env PYTHONPATH= python -c 'import tabulate; print(tabulate.__version__)'(and tell us the tabulate version number)
env PYTHONPATH= python -c 'import cli_helpers; print(cli_helpers.__version__)'(and tell us the cli_helpers version number)
which tabulate
(and tell us if there is any output at all)
The guess would be that Debian installs a different version of
tabulatethat our software expects.tabulaterecently made a release with a breaking change. Perhaps we should do some version probing as was initially suggested in dbcli/cli_helpers#107.I have the same issue unfortunately, here is some of the requested debug output.
env PYTHONPATH= python3 -c 'import tabulate; print(tabulate.__version__)' 0.9.0 env PYTHONPATH= python3 -c 'import cli_helpers; print(cli_helpers.__version__)' 2.11.0 which tabulate /usr/bin/tabulateThe problem is the same when using
--myclirc /usr/lib/python3/dist-packages/mycli/myclirc@schnapster many thanks! That's strange because those are the two latest versions of cli_helpers and tabulate. But I will look into this tomorrow, and try to replicate.
Edit: the above is incorrect.
0.9.0is not the latest version of tabulate.Should be fixed in https://github.com/dbcli/mycli/releases/tag/v1.66.0 !
Apologies, I should have checked the mycli version. This morning, v1.64 was installed over 1.62, and the problem is gone. It may have already been solved in the current codebase 😬
Nvm I got too excited there, its still broken for me when running a query (but connection works).
I downloaded 1.66 from Debian Sid repo, and heres the dependency output of --checkup:
### Key Python dependencies: cli_helpers version 2.11.0 (latest 2.12.0) click version 8.1.8 (latest 8.3.1) prompt_toolkit version 3.0.52 (latest 3.0.52) pymysql version 1.1.1 (latest 1.1.2) tabulate version 0.9.0 (latest 0.10.0)cli_helpers 2.12 is not available on debian sid yet it seems
Yes, the fix depends on the newest
cli_helpers, or a newertabulate.My workaround for now:
edited
/usr/lib/python3/dist-packages/cli_helpers/tabular_output/tabulate_adapter.py:- tkwargs.update(preserve_whitespace=preserve_whitespace) + tkwargs.update()
Every command crashes with the message
tabulate() got an unexpected keyword argument 'preserve_whitespace'.Here is a session, with added blank lines to increase readability.
System
--checkupsays everything is alright, except that fzf is not installed.