Jump to content

Topic on Manual talk:Pywikibot

Error handling with Pywikibot

4
Yann (talkcontribs)

Hi, I upload files on Commons with Pywikibot (see https://commons.wikimedia.org/w/index.php?title=Special:ListFiles/YannBot&ilshowall=1 ). It works but I get a lot of errors, mainly due to time out from server side. Now it would OK if I could just tell the bot to start again if the upload fails. I use a bash script to generate all the needed data, but the output is always true whatever happened. How to do error handling? Thanks,

$PYTHON ~/core_stable/pwb.py upload "$filename" $sim $chunk -noverify -filename:"$uploadname" -keep -abortonwarn -descfile:"$desc"

Whym (talkcontribs)

As far as I can see, it does exit successfully upon server side errors at least. If you want to change that, I think you can submit a feature request (or even better, a patch to the source code) at phabricator.

Yann (talkcontribs)

I don't know Python enough to propose a patch. See phab:T338969.

Whym (talkcontribs)

If you already created the task, that's a good start. It doesn't have to be a "feature request" per se, as long as the problem is correctly described. Other users/developers may or may not re-categorize it later.

Reply to "Error handling with Pywikibot"