jenkins-bot submitted this change.
[bugfix] Ignore UnicodeDecodeError on input
Bug: T258143
Change-Id: I266879db82b12125b15ede9f66cf4e2944b88f51
---
M pywikibot/userinterfaces/terminal_interface_base.py
1 file changed, 6 insertions(+), 0 deletions(-)
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,
To view, visit change 638503. To unsubscribe, or for help writing mail filters, visit settings.