Another way is to run the cache script as:

pwb cache -delete

A third way is to use API_config_expiry as global option:

pwb -API_config_expiry:0 <yourscript> <script options>

A better way counted as 4th possibility is to use preload_sites script:

pwb -API_config_expiry:0 preload_sites

This script is to download siteinfo of all sites very quickly by using concurrent futures.

And a 5th way is to just wait for 30 days because this is the default wait time for the cache which is set with API_config_expiry in config.py. 

Further ideas?

Best
xqt

Am 27.03.2023 um 21:08 schrieb Bináris <wikiposta@gmail.com>:


Solved: I emptied the apicache-py3 directory, and it works. It always helps if you write about a problem publicly, the solution comes after. :-)

Bináris <wikiposta@gmail.com> ezt írta (időpont: 2023. márc. 27., H, 20:52):
Today in wikipedia:hu namespaces 118, 119 were set. See T33308.

Now I have problems with the new namespaces.

Message: KeyError: '118 is not a known namespace. Maybe you should clear the api cache.'
Source: Pywikibot\pywikibot\site\_namespace.py

>>> list(site.namespaces())
[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 90, 91, 92, 93, 100, 101, 710, 711, 828, 829, 2300, 2301, 2302, 2303]

How to clear the API cache? Should Pywikibot automatically recognaize the new namespaces or shall I alter the code somewhere?

--
Bináris


--
Bináris
_______________________________________________
pywikibot mailing list -- pywikibot@lists.wikimedia.org
Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/YNTJEIP2PGYPNDARNFGIF4RXQX2U33DK/
To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org