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

misspelled keyword arg in qtconsole.util.compute_item_matrix #600

Closed
ghost opened this issue Jan 15, 2024 · 2 comments
Closed

misspelled keyword arg in qtconsole.util.compute_item_matrix #600

ghost opened this issue Jan 15, 2024 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 15, 2024

expected args & kwargs the compute_item_matrix are:

def compute_item_matrix(items, empty=None, *, separator_size=2, displaywith=80)

Consumers of this function (eg. completion_html.CompletionHtml.show_items, line 315) call on it with the correctly spelled keyword, 'displaywidth'.

As well, within the compute_item_matrix function itself, line 195, it tries to pass on displaywith to another function using the correctly spelled keyword, displaywidth, which it doesn't have.

I fixed the misspelled keyword in my local copy of util.py, and as expected, it resolved the issue and no longer raises a TypeError exception crashing the instance.

*** quick test (after fixing spelling) ***

Python 3.11.7 (main, Dec 15 2023, 12:09:56) [Clang 14.0.6 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.20.0 -- An enhanced Interactive Python. Type '?' for help.

from qtconsole.util import compute_item_matrix

compute_item_matrix(['a', 'b', 'c'], displaywidth=100)
Out[3]: 
([['a', 'b', 'c']],
 {'columns_numbers': 3, 'rows_numbers': 1, 'columns_width': [1, 1, 1]})

@ccordoba12
Copy link
Collaborator

Hey @martsenecal, thanks for reporting. This is a duplicate of issue #591 and fixed in our latest version (5.5.1), so please update to that version.

@ccordoba12 ccordoba12 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2024
@ghost
Copy link
Author

ghost commented Jan 15, 2024

Most awesome!

Thank you,
-mart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant