Gerrit Patch Uploader has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/348444 )

Change subject: config2: Fix UnicodeDecodeError
......................................................................

config2: Fix UnicodeDecodeError

Windows users may have broken function _win32_extension_command when:
- Python 2 is used,
- no program is configured to open .py files
So windows generates a non-ascii error message
This intercept all calls to pywikibot, such pwb.py or
generate_user_files.py.
As proposed by XZise, use {1!r} instead of {1} miraculously solve the
problem.

Bug: T120222
Change-Id: I47e2756259ecbc1279e1124c076622177b3fc1d6
---
M pywikibot/config2.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/44/348444/1

diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 90877ba..e0bac1e 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -942,7 +942,7 @@
             return cmd[:-1].strip()
     except WindowsError as e:
         # Catch any key lookup errors
-        output('Unable to detect program for file extension "{0}": {1}'.format(
+        output('Unable to detect program for file extension "{0}": 
{1!r}'.format(
             extension, e))
 
 

-- 
To view, visit https://gerrit.wikimedia.org/r/348444
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47e2756259ecbc1279e1124c076622177b3fc1d6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com>
Gerrit-Reviewer: Framawiki <framaw...@tools.wmflabs.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to