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]


--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/777296
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: I9863917543db1a1730477e4b30472474ee58ee2a
Gerrit-Change-Number: 777296
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Meno25 <[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