jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/618108 )
Change subject: [bugfix] Escape bot password correctly ......................................................................
[bugfix] Escape bot password correctly
- use repr function to escape password correctly - remove __future__ import lines
Bug: T259488 Change-Id: I5a0f528d50a47b9ec750c473b2e47381a6d466fb --- M generate_user_files.py 1 file changed, 1 insertion(+), 3 deletions(-)
Approvals: Matěj Suchánek: Looks good to me, approved jenkins-bot: Verified
diff --git a/generate_user_files.py b/generate_user_files.py index 1e6a325..f8437f2 100755 --- a/generate_user_files.py +++ b/generate_user_files.py @@ -216,7 +216,6 @@ {config_text}"""
SMALL_CONFIG = """# -*- coding: utf-8 -*- -from __future__ import absolute_import, division, unicode_literals family = '{main_family}' mylang = '{main_code}' {usernames} @@ -234,7 +233,6 @@ # # See https://www.mediawiki.org/wiki/Manual:Pywikibot/BotPasswords for more # information. -from __future__ import absolute_import, division, unicode_literals {botpasswords}"""
@@ -343,7 +341,7 @@ # Arbitrarily use the first key as default settings main_family, main_code = userlist[0].family, userlist[0].code botpasswords = '\n'.join( - "('{0}', BotPassword('{1}', '{2}'))".format(*botpassword) + "('{}', BotPassword('{}', {!r}))".format(*botpassword) for botpassword in botpasswords)
config_text = copy_sections()
pywikibot-commits@lists.wikimedia.org