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): """
pywikibot-commits@lists.wikimedia.org