jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/777296 )
Change subject: [bugfix] Take into account that global account may be missing ......................................................................
[bugfix] Take into account that global account may be missing
Don't try to upcast timestamp from global userinfo if global account does not exists.
Bug: T305351 Change-Id: I9863917543db1a1730477e4b30472474ee58ee2a --- M pywikibot/site/_apisite.py 1 file changed, 3 insertions(+), 2 deletions(-)
Approvals: Meno25: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py index 4cfe63a..2210ec9 100644 --- a/pywikibot/site/_apisite.py +++ b/pywikibot/site/_apisite.py @@ -557,8 +557,9 @@ assert 'globaluserinfo' in uidata['query'], \ "API userinfo response lacks 'globaluserinfo' key" data = uidata['query']['globaluserinfo'] - ts = data['registration'] - data['registration'] = pywikibot.Timestamp.fromISOformat(ts) + if 'missing' not in data: + ts = data['registration'] + data['registration'] = pywikibot.Timestamp.fromISOformat(ts) self._globaluserinfo[user] = data return self._globaluserinfo[user]
pywikibot-commits@lists.wikimedia.org