diff --git a/mwclient/client.py b/mwclient/client.py index 98af0488864332cfa02feef2951bb975ca08ac34..97b8b2b6b2969e53b3e782ddeda9912b3dcaa4cb 100644 --- a/mwclient/client.py +++ b/mwclient/client.py @@ -307,6 +307,13 @@ class Site(object): sleeper.sleep() return False + # cope with https://phabricator.wikimedia.org/T106066 + if (info['error'].get('code') == u'mwoauth-invalid-authorization' and + 'Nonce already used' in info['error'].get('info')): + log.warning('retrying due to nonce error https://phabricator.wikimedia.org/T106066') + sleeper.sleep() + return False + if 'query' in info['error']: # Semantic Mediawiki does not follow the standard error format raise errors.APIError(None, info['error']['query'], kwargs)