sir-lancebot icon indicating copy to clipboard operation
sir-lancebot copied to clipboard

ValueError: dictionary update sequence element #0 has length 3; 2 is required

Open sentry[bot] opened this issue 4 years ago • 4 comments

Sentry Issue: SIR-LANCEBOT-6C

ValueError: dictionary update sequence element #0 has length 3; 2 is required
(1 additional frame(s) were not displayed)
...
  File "bot/exts/core/help.py", line 511, in new_help
    await HelpSession.start(ctx, *commands)
  File "bot/exts/core/help.py", line 452, in start
    session = cls(ctx, *command, **options)
  File "bot/exts/core/help.py", line 97, in __init__
    self.query = self._get_query(query_str)
  File "bot/exts/core/help.py", line 151, in _get_query
    self._handle_not_found(query)
  File "bot/exts/core/help.py", line 164, in _handle_not_found
    raise HelpQueryNotFound(f'Query "{query}" not found.', dict(result))

Unhandled command error: dictionary update sequence element #0 has length 3; 2 is required

Seems to be caused by running .help latex possibly other commands too.

sentry[bot] avatar Sep 07 '21 18:09 sentry[bot]

I'm making a guess that this is caused by a faulty disabling of .latex.

Kronifer avatar Sep 13 '21 01:09 Kronifer

Looking into it i'm guessing this was caused by the switch from fuzzywuzzy to rapidfuzz, https://github.com/python-discord/sir-lancebot/pull/799/files, process.extract returns tuples with 3 elements, while creating a dictionary only accepts 2.

We can fix this the same way as Python bot does it, https://github.com/python-discord/bot/blob/ec8e3e3f69e9c9b938929efece487b229fc1dd9c/bot/exts/info/help.py#L130

As a note, it seems only the keys of this dictionary (the string matches) are actually used in the end: https://github.com/python-discord/sir-lancebot/blob/8a410f3abd39a1b48c514d32651a50d4bdced492/bot/exts/core/help.py#L518

wookie184 avatar Sep 19 '21 16:09 wookie184

This is very noticiable in the help command image

onerandomusername avatar Sep 26 '21 19:09 onerandomusername

I will be working on this.

RohanJnr avatar Jun 17 '22 18:06 RohanJnr

Implemented in #1064

shtlrs avatar Mar 22 '24 14:03 shtlrs