I have found that the deletion function has a bug. Apparently the tokens it uses for the page do not match the deletion token for the page, which seems to be different... I don't know if it is different for each page it deletes, but I developed somewhat of a hacked solution. If anyone wants to attempt to beautify it or create a better solution, be my guest.
I have attached it to this email and also uploaded it to sourceforge.
A corrected solution with a patch has been proposed on sourceforge. The delete function works once you get the token after a force login line with sysop = True
wikibots-l@lists.wikimedia.org