jenkins-bot has submitted this change and it was merged.
Change subject: Restore Page.__repr__ to pre-unicode_literals behaviour
......................................................................
Restore Page.__repr__ to pre-unicode_literals behaviour
1e54a7d introduce unicode_literals, but altered the output
of Page.__repr__. Prior to that change, Page.__repr__ in py2
emitted non-ascii encoded using config.console_encoding so it
would display correctly in the console, and the logging layer
would then recode it to the required encoding.
Change-Id: I7da9ba18fcdfa31c6f78db68179a4c953bc649a7
---
M pywikibot/page.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 4e29b24..bd9bb8a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -273,8 +273,8 @@
def __repr__(self):
"""Return a more complete string
representation."""
- title =
self.title().encode(config.console_encoding).decode('unicode-escape')
- return '{0}({1})'.format(self.__class__.__name__, title)
+ title = self.title().encode(config.console_encoding)
+ return str('{0}({1})').format(self.__class__.__name__, title)
def _cmpkey(self):
"""
--
To view, visit
https://gerrit.wikimedia.org/r/203524
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7da9ba18fcdfa31c6f78db68179a4c953bc649a7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>