jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/597313 )
Change subject: [bugfix] Do not change usernames when creating a Site
......................................................................
[bugfix] Do not change usernames when creating a Site
usernames is a defaultdict which inserts a new item if
it does not already exists. Therefore
code_to_user = config.usernames['*'].copy()
inserts an empty dict with '*' if it not already exists
but this changes the usernames and lead scripts to fail.
Bug: T253127
Change-Id: I6740968adec0e67c1a3e0e1a24603282a2986a8e
---
M pywikibot/__init__.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
D3r1ck01: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 80b0122..dd2b6ad 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -1243,7 +1243,9 @@
# config.usernames is initialised with a defaultdict for each family name
family_name = str(fam)
- code_to_user = config.usernames['*'].copy()
+ code_to_user = {}
+ if '*' in config.usernames: # T253127: usernames is a defaultdict
+ code_to_user = config.usernames['*'].copy()
code_to_user.update(config.usernames[family_name])
user = user or code_to_user.get(code) or code_to_user.get('*')
--
To view, visit
https://gerrit.wikimedia.org/r/597313
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6740968adec0e67c1a3e0e1a24603282a2986a8e
Gerrit-Change-Number: 597313
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)