jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/439383 )
Change subject: win32_unicode.py: Do not work around issue2128 for PY3 ......................................................................
win32_unicode.py: Do not work around issue2128 for PY3
I'm having trouble working with pydev debugger on Windows because its cmd arguments (--multiproc, --qt-support=auto, --client, --port, and --file) are included in GetCommandLineW results. That leads to superfluous arguments being passed to pywikibot which is sometimes forbidden.[1] The default sys.argv does not have this issue.
issue2128 does not exist in Python 3. So at least for Python 3 we don't need the workaround.
[1]: For example see: https://phabricator.wikimedia.org/diffusion/PWBC/browse/master/generate_user...
Change-Id: If7e736e09fafe78e24ca34aceed8df0d96a35d1f --- M pywikibot/userinterfaces/win32_unicode.py 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/userinterfaces/win32_unicode.py b/pywikibot/userinterfaces/win32_unicode.py index 45588fe..3287e0a 100755 --- a/pywikibot/userinterfaces/win32_unicode.py +++ b/pywikibot/userinterfaces/win32_unicode.py @@ -337,6 +337,10 @@ _complain('exception {!r} while fixing up sys.stdout and sys.stderr' .format(e))
+ if PY3: + # no need to work around issue2128 since it's a Python 2 only issue + return stdin, stdout, stderr, argv + # While we're at it, let's unmangle the command-line arguments:
# This works around http://bugs.python.org/issue2128.
pywikibot-commits@lists.wikimedia.org