jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/638503 )
Change subject: [bugfix] Ignore UnicodeDecodeError on input ......................................................................
[bugfix] Ignore UnicodeDecodeError on input
Bug: T258143 Change-Id: I266879db82b12125b15ede9f66cf4e2944b88f51 --- M pywikibot/userinterfaces/terminal_interface_base.py 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py index 9aebd99..bc314f6 100755 --- a/pywikibot/userinterfaces/terminal_interface_base.py +++ b/pywikibot/userinterfaces/terminal_interface_base.py @@ -278,6 +278,10 @@ while True: self.output(question + ' ') text = self._input_reraise_cntl_c(password) + + if text is None: + continue + if text: return text
@@ -296,6 +300,8 @@ text = self._raw_input() except KeyboardInterrupt: raise QuitKeyboardInterrupt() + except UnicodeDecodeError: + return None # wrong terminal encoding, T258143 return text
def input_choice(self, question: str, options, default: str = None,
pywikibot-commits@lists.wikimedia.org