jayvdb created this task.
jayvdb added a subscriber: jayvdb.
jayvdb added a project: pywikibot-core.
Herald added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION
Steps to reproduce:
1. create Site object that is logged in
2. invalidate the cookie of that Site object, such as by logging out in
another session
3. call a write operation such as `APISite. purgepages`
Expected results:
page purge occurs normally
Actual results:
API raises `assertuserfailed`, which is not handled
```
$ python pwb.py shell
Welcome to the Pywikibot interactive shell!
>>> s = pywikibot.Site('en', 'wikipedia')
>>> s.login()
Logging in to wikipedia:en as JVbot
>>> s = pywikibot.Site('en', 'wikipedia') # paraminfo is customised for
logged in users
>>> pywikibot._sites = {}
>>> pywikibot.Site('en', 'wikipedia').logout() # log out of new site object
>>> s.purgepages(pages='User:Example') # re-use original site object
Traceback (most recent call last):
File "<console>", line 1, in <module>
File ".../pywikibot/site.py", line 1165, in callee
return fn(self, *args, **kwargs)
File ".../pywikibot/site.py", line 5076, in purgepages
result = req.submit()
File ".../pywikibot/data/api.py", line 2102, in submit
raise APIError(**result['error'])
APIError: assertuserfailed: Assertion that the user is logged in failed
```
TASK DETAIL
https://phabricator.wikimedia.org/T108942
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb
Cc: Aklapper, pywikibot-bugs-list, jayvdb, Malyacko
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs