Multichill added a comment.
I think I found what is going wrong. site.get_tokens(['csrf']) gets you a new
token, but doesn't update the internal token state:
>>> import pywikibot
>>> site = pywikibot.Site(u'commons', u'commons')
>>> print (site.tokens['csrf'])
1ade99bef6b895e188692438b12cbd9e5f4aacac+\
>>> site.get_tokens(['csrf'])
{'csrf': '113400e3b87ae1d1d53ec4ebee9bde105f4aacb8+\\'}
>>> print (site.tokens['csrf'])
1ade99bef6b895e188692438b12cbd9e5f4aacac+\
Looks like a site.tokens.load_tokens(['csrf']) does refresh the token, all
quite confusing.
TASK DETAIL
https://phabricator.wikimedia.org/T261050
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Multichill
Cc: matej_suchanek, daniel, Krinkle, eprodromou, Tgr, Dvorapa, Xqt, Aklapper,
Reedy, pywikibot-bugs-list, Multichill, JohnsonLee01, SHEKH, Naike, Dijkstra,
CBogen, Khutuck, Zkhalido, WDoranWMF, Viztor, DannyS712, Wenyi, Amorymeltzer,
Ramsey-WMF, Tbscho, MayS, Sethakill, Mdupont, JJMC89, dg711, Poyekhali,
Agabi10, Altostratus, Taiwania_Justo, Avicennasis, Pchelolo, Ixocactus,
Wong128hk, mys_721tx, Bawolff, El_Grafo, Dinoguy1000, jayvdb, Anomie, Masti,
Alchimista, Steinsplitter, Rxy, Keegan, Legoktm
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs