Last modified: 2013-10-25 16:30:43 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1396/ Reported by: xqt Created on: 2012-01-15 16:26:09 Subject: category.py mistakenty removes not affected categories Original description: Pywikipedia trunk/pywikipedia/ \(r9826, 2011/10/30, 15:03:29\) Python 2.7.2 \(default, Jun 12 2011, 14:24:46\) \[MSC v.1500 64 bit \(AMD64\)\] config-settings: use\_api = True use\_api\_login = True unicode test: ok I found some categories removed on template which are not affected by the command line: category.py remove -from:Kategorie:Vorlage:mit\_Einzelnachweisen Here is a sample: http://de.wikipedia.org/w/index.php?title=Vorlage%3AInfobox\_Gemeindeverband\_in\_Deutschland&action=historysubmit&diff=98393799&oldid=91338734 cosmetic\_changes was switched off.
I changed the behavour of catlib.change\_category\(\). Categories of templates always are always replaced by wikipedia.replaceCategoryInPlace\(\) rather than by wikipedia.replaceCategoryLinks\(\). The bug ist still remainig for some circumstances: Page.categories\(\) gives categories via api whereas replaceCategoryLinks\(\) works like wikipedia.getCategoryLinks\(\) which is quite different.
- **priority**: 5 --> 3
I made some experiments. I think the problem is in textlib.py. replaceCategoryLinks calls removeCategoryLinksAndSeparator I suspect that removeCategoryLinksAndSeparator removes these categories but nobody puts them back because they are not explicitely listed as categories.
*** This bug has been marked as a duplicate of bug 55315 ***