jenkins-bot submitted this change.

View Change

Approvals: Matěj Suchánek: Looks good to me, approved jenkins-bot: Verified
[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(-)

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()

To view, visit change 618108. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I5a0f528d50a47b9ec750c473b2e47381a6d466fb
Gerrit-Change-Number: 618108
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: 000Tom0000 <stroobantstom@gmail.com>
Gerrit-CC: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-MessageType: merged