Skip to content

Commit

Permalink
Add workaround for phab:T211233
Browse files Browse the repository at this point in the history
The post edit cookies makes no sense for bots, but it seems like the PR
for https://phabricator.wikimedia.org/T211233 is not going to be merged,
so we have to work around it.

Closes #221
  • Loading branch information
danmichaelo committed Aug 2, 2019
1 parent 0e0d85a commit e9b7095
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mwclient/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ def do_edit():
if 'newtimestamp' in result['edit'].keys():
self.last_rev_time = parse_timestamp(result['edit'].get('newtimestamp'))

# Workaround for https://phabricator.wikimedia.org/T211233
for cookie in self.site.connection.cookies:
if 'PostEditRevision' in cookie.name:
self.site.connection.cookies.clear(cookie.domain, cookie.path, cookie.name)

# clear the page text cache
self._textcache = {}
return result['edit']
Expand Down

0 comments on commit e9b7095

Please sign in to comment.