jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/766779 )
Change subject: [cleanup] no longer use win32_unicode for Python 3.6+ ......................................................................
[cleanup] no longer use win32_unicode for Python 3.6+
The issue is solved in Python 3.6+ https://bugs.python.org/issue1602
Change-Id: Id507c11040e186ebc0c26173a8dc03fca89547a9 --- M pywikibot/userinterfaces/terminal_interface_win32.py 1 file changed, 11 insertions(+), 8 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/userinterfaces/terminal_interface_win32.py b/pywikibot/userinterfaces/terminal_interface_win32.py index 05b62eb..9db1fac 100755 --- a/pywikibot/userinterfaces/terminal_interface_win32.py +++ b/pywikibot/userinterfaces/terminal_interface_win32.py @@ -1,12 +1,13 @@ """User interface for Win32 terminals.""" # -# (C) Pywikibot team, 2003-2020 +# (C) Pywikibot team, 2003-2022 # # Distributed under the terms of the MIT license. # import ctypes
-from pywikibot.userinterfaces import terminal_interface_base, win32_unicode +from pywikibot.tools import PYTHON_VERSION +from pywikibot.userinterfaces import terminal_interface_base
windowsColors = { @@ -37,12 +38,14 @@ def __init__(self): """Initializer.""" super().__init__() - (stdin, stdout, stderr, argv) = win32_unicode.get_unicode_console() - self.stdin = stdin - self.stdout = stdout - self.stderr = stderr - self.argv = argv - self.encoding = 'utf-8' + if PYTHON_VERSION == (3, 5): # issue1602 solved in Python 3.6 + from pywikibot.userinterfaces import win32_unicode + stdin, stdout, stderr, argv = win32_unicode.get_unicode_console() + self.stdin = stdin + self.stdout = stdout + self.stderr = stderr + self.argv = argv + self.encoding = 'utf-8'
def support_color(self, target_stream): """Return whether the target stream supports actually color."""
pywikibot-commits@lists.wikimedia.org