My bot has started throwing the following error, and I'm wondering if
anyone has a clue about what might have changed. It's using the shared
stable version on ToolForge, which I believe was updated to 8.0.3. today.
TIA for any help.
File "/data/project/william-avery-bot/wikipythonics/cleanseRefs.py", line
118, in treat_page
55, in wrapper
handle(func, self, *args, **kwargs)
34, in handle
func(self, *args, **kwargs)
line 680, in editEntity
line 313, in editEntity
updates = self.repo.editEntity(
92, in callee
return fn(self, *args, **kwargs)
line 311, in editEntity
params['token'] = self.tokens['csrf']
line 57, in __getitem__
KeyError: "Invalid token 'csrf' for user 'William Avery Bot' on
The Developer Advocacy team is excited to share with you a new set of
educational materials you can use to learn and teach others about Pywikibot
. These new materials are based on content originally presented as part
of the Small wiki toolkits initiative . Please read and share these
materials, give feedback in Phabricator  or on Talk pages, or edit the
pages directly if you find errors. This will help improve the materials for
these workshops as well as workshops planned for the future.
Last year, the Small wiki toolkits initiative held monthly technical
workshops about using, building, and hosting bots .
In response to feedback received from participants , this year the
Developer Advocacy team launched an initiative (Phabricator task: ) to
develop on-wiki learning and training materials based on the previous
workshops. The goal of these materials is to make it easier for you to
learn about Pywikibot and teach others in your community about it. Drafts
for two workshops  are now ready for your review:
- How to run basic scripts using Pywikibot
- How to host a bot on Toolforge
Materials for each workshop come in two formats:
1. Self-study guide
- explains how to learn a given subject on your own
- links to different resources on wikis and other sites without duplicating
2. Workshop organizer's handbook
- teaches you how to teach the subject to others
- explains how to prepare a workshop that you can run during a hackathon or
a conference. If you've ever wanted to give a talk about Pywikibot but
didn't have the time to design it, the handbook should help.
*How to get involved*
Please read the linked materials and provide feedback in Phabricator or on
talk pages. Is this the right format for learners and trainers? Did we miss
anything? Are there sections that are difficult to follow or make no sense?
Please let us know. Your input will help inform the next steps for the
development of the remaining materials.
If you want to contribute any changes or corrections, you can do so either
directly on the pages, or by leaving comments on talk pages or in
Phabricator. Thank you for your help!
On behalf of the Developer Advocacy team,
Kamil Bach (they/them)
I wrote a module which handles Flagged Revisions in huwiki.
It has a function called cosmeticable(page) to tell if a page is eligible
for cosmetic changes according to huwiki rules.
It also has a CosmeticableFilterPageGenerator which yields only
cosmeticable pages. But it may not have a command-line argument as it
is not in the framework.
Now, what is the way to tell Pywikibot that cosmetic changes should be done
only on pages where the function returns True or which are from this
I don't want to modify the core system on my device, because it will be
disrupted when refreshing and is not distributable to other users.
In eneral, is there a way to use own _global_ command-line arguments?