Page MenuHomePhabricator

input_list_choice fails with ValueError if choice is given as list entry instead of sequence index
Closed, ResolvedPublic

Description

input_list_choice choice may be given either as sequence index or as the entry itself. When giving a wrong choice an "Error: Invalid Response" is printed. But in case of giving a wrong entry this fails and a ValueError is raised instead. The reason is a wrong fetched exception. Sequence.index does not raise an IndexError but a ValueError

Event Timeline

Xqt triaged this task as Medium priority.Jan 17 2021, 10:25 AM

Change 656608 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Improvements for input_list_choice()

https://gerrit.wikimedia.org/r/656608

Change 656608 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Improvements for input_list_choice()

https://gerrit.wikimedia.org/r/656608

JJMC89 removed a project: Patch-For-Review.