XZise added a comment.
Ah okay, I tested it with that:
import pywikibot s = pywikibot.Site('ru', 'wikipedia') p = pywikibot.Page(s, 'Файл:Groz-14.PNG') t = list(p.templatesWithParams()) list(p.templatesWithParams())
[(Page(b'\xd0\xa8\xd0\xb0\xd0\xb1\xd0\xbb\xd0\xbe\xd0\xbd:\xd0\x98\xd0\xb7\xd0\xbe\xd0\xb1\xd1\x80\xd0\xb0\xd0\xb6\xd0\xb5\xd0\xbd\xd0\xb8\xd0\xb5'), ['Время создания=2010', 'Источник=Станислав Гайдук', 'Автор=Станислав Гайдук', 'Описание=Грозный, фонтан, 2010 год.']), (Page(b'\xd0\xa8\xd0\xb0\xd0\xb1\xd0\xbb\xd0\xbe\xd0\xbd:PD-self'), []), (Page(b'\xd0\xa8\xd0\xb0\xd0\xb1\xd0\xbb\xd0\xbe\xd0\xbd:NowCommons'), [])]
[_[0] for _ in t]
[Page(b'\xd0\xa8\xd0\xb0\xd0\xb1\xd0\xbb\xd0\xbe\xd0\xbd:\xd0\x98\xd0\xb7\xd0\xbe\xd0\xb1\xd1\x80\xd0\xb0\xd0\xb6\xd0\xb5\xd0\xbd\xd0\xb8\xd0\xb5'), Page(b'\xd0\xa8\xd0\xb0\xd0\xb1\xd0\xbb\xd0\xbe\xd0\xbd:PD-self'), Page(b'\xd0\xa8\xd0\xb0\xd0\xb1\xd0\xbb\xd0\xbe\xd0\xbd:NowCommons')]
[_[0] in ['NowCommons'] for _ in t]
[False, False, False]
[_[0].title(withNamespace=False) in ['NowCommons'] for _ in t]
[False, False, True]
So I think at some point templatesWithParams returned a Page instance instead of a string and nowcommons hasn't been updated.
TASK DETAIL https://phabricator.wikimedia.org/T97248
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: XZise, Aklapper, Rubin16, jayvdb, pywikipedia-bugs