jenkins-bot has submitted this change and it was merged.
Change subject: Fall back to utf-8 console encoding
......................................................................
Fall back to utf-8 console encoding
Bug: T93474
Change-Id: Iec28824bd74377c33a08964307449cebc90279e4
---
M pywikibot/config2.py
1 file changed, 6 insertions(+), 5 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 0ef584b..13c4578 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -1007,12 +1007,13 @@
"Please inform the maintainers if you depend on it." % _key,
_ConfigurationDeprecationWarning)
-# Fix up default console_encoding
+# If we cannot auto-detect the console encoding (e.g. when piping data)
+# assume utf-8. On Linux, this will typically be correct; on windows,
+# this can be an issue when piping through more. However, the behavior
+# when redirecting to a file utf-8 is more reasonable.
+
if console_encoding is None:
- if sys.platform == 'win32':
- console_encoding = 'cp850'
- else:
- console_encoding = 'iso-8859-1'
+ console_encoding = 'utf-8'
# Fix up transliteration_target
if transliteration_target == 'not set':
--
To view, visit https://gerrit.wikimedia.org/r/231568
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iec28824bd74377c33a08964307449cebc90279e4
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits