matej_suchanek added a comment.
So obviously this happened due to some server problem and non-JSON response
where JSON is expected (except `ValueError` in `Request._json_loads`). Why this
happened is a mystery for me, but it isn't really important. Further down:
name=pywikibot/data/api.py
for param in self._params:
if param.endswith('limit'):
# param values are stored a list of str
value = self[param][0]
if value.isdigit(): # <-- this is where it crashes
>>> gen.request._params
{'titles': ['1298', '1816', '1881', '1941', '1948 Winter Olympics', '2013',
'202
1 Western North America heat wave', '50 Greatest Players in NBA History',
'Abdur
Razzaq Iskander', 'Adolf, King of the Romans', 'Albert I of Germany',
'Alkaliha
lobacillus', 'All About That Bass', 'Archaeological site', 'Assassination
of Jam
es A. Garfield', 'Balderdash', 'Baltimore and Potomac Railroad', 'Basilicas
in t
he Catholic Church', 'Bass Strait', 'Battle of Göllheim', 'Berlin to
Kitchener n
ame change', 'COVID-19 pandemic', 'Calendar of saints', 'Carlo Maderno',
'Charle
s Tupper', 'Condominium', 'Contempt of court', 'Cultural Property (Japan)',
'Dea
ths in 2021', 'Donato Bramante'], 'prop': ['info', 'categoryinfo',
'langlinks',
'templates'], 'action': ['query'], 'indexpageids': [True], 'continue': ['',
'',
'info', 'categoryinfo', 'templates', 'userinfo'], 'tllimit': [500],
'lllimit': [
'5'], 'meta': ['userinfo'], 'uiprop': ['blockinfo', 'hasmsg'], 'maxlag':
['5'],
'format': ['json'], 'llcontinue': ['68048055', 'ko'], 'tlcontinue':
['65984422',
'10', 'SDcat']}
>>> {key: value for key, value in gen.request._params.items() if
key.endswith('l
imit')}
{'tllimit': [500], 'lllimit': ['5']} # <--- int and str, respectively
So "`param values are stored a list of str`" isn't always truth.
TASK DETAIL
https://phabricator.wikimedia.org/T286018
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: matej_suchanek
Cc: matej_suchanek, Aklapper, Xqt, pywikibot-bugs-list, Jyoo1011, JohnsonLee01,
SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont,
JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]