When running with -checkcurrent option, I believe the following actions happen.
1. Check the local link to the Commons category for a match.
1a. If a match is found, do nothing and move on.
1b. If a category redirect is found on Commons, it will ask to (or -always) update the link on local wiki.
1c. If neither a category nor a redirect is found, it will scan all the interwiki links from the local wiki page, and see if a Commons category is found on another wiki. If one is found, it will ask to (or -always) update the link on the local wiki to match.
1d. If no category link is found at all, it should remove the template. (Or at least provide an error notice of some kind.)
Currently, Step 1d doesn't happen.
To duplicate, simply add {{commonscat}} to any page with no matching category on Commons, then try scanning the page.
The curious thing is it skips (or doesn't check) the broken category link. e.g., when Category:Bar doesn't exist at Commons, output is:
Working on Category:Foo
Commonscat template is already on Category:Foo
Commonscat link at Category:Foo to Category:Foo is ok
Working on Category:Bar
Commonscat template is already on Category:Bar
Working on Category:Baz
Commonscat template is already on Category:Baz
Commonscat link at Category:Baz to Category:Baz is ok
python version.py
Pywikipedia [http] trunk/pywikipedia (r9419, 2011/07/23, 11:52:31)
Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01)
[GCC 4.3.4 20090804 (release) 1]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
Or, perhaps instead of removing it outright, it could dump a report to the Bot's userspace.
Also, many wikis use {{commonscat}} in article space as well - -checkcurrent currently only checks category namespace - it should check links in article space as well.