jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[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.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I266879db82b12125b15ede9f66cf4e2944b88f51
Gerrit-Change-Number: 638503
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Arjunaraoc <arjunaraoc@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged