jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/998295?usp=email )

Change subject: [bugfix] use str instead of repr for family
......................................................................

[bugfix] use str instead of repr for family

family is an object and not a string. Therefore do not use repr
for these variables when printing.

Bug detected with T356782

Bug: T356782
Change-Id: Ifde56185f8c095d6cdccfbe8063301a0ffb8f312
---
M pywikibot/scripts/version.py
M pywikibot/site/_apisite.py
2 files changed, 17 insertions(+), 2 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/pywikibot/scripts/version.py b/pywikibot/scripts/version.py
index b0e1156..1178caf 100755
--- a/pywikibot/scripts/version.py
+++ b/pywikibot/scripts/version.py
@@ -93,7 +93,7 @@
     for family, usernames in pywikibot.config.usernames.items():
         if not usernames:
             continue
-        pywikibot.info(f'Usernames for family {family!r}:')
+        pywikibot.info(f"Usernames for family '{family}':")
         for lang, username in usernames.items():
             pywikibot.info(f'\t{lang}: {username}')

diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index b66ae01..8004a75 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -415,7 +415,7 @@
                 error_msg = ('No username has been defined in your '
                              'user config file: you have to add in this '
                              'file the following line:\n'
-                             'usernames[{family!r}][{lang!r}]= {username!r}'
+                             "usernames['{family}'][{lang!r}]= {username!r}"
                              .format(family=self.family,
                                      lang=self.lang,
                                      username=self.userinfo['name']))

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/998295?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ifde56185f8c095d6cdccfbe8063301a0ffb8f312
Gerrit-Change-Number: 998295
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to