Last modified: 2013-10-25 16:30:43 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57221, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55221 - category.py mistakenty removes not affected categories
category.py mistakenty removes not affected categories
Status: RESOLVED DUPLICATE of bug 55315
Product: Pywikibot
Classification: Unclassified
category.py (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-05 04:45 UTC by Kunal Mehta (Legoktm)
Modified: 2013-10-25 16:30 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:45:35 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.
Comment 1 Kunal Mehta (Legoktm) 2013-10-05 04:45:37 UTC
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.
Comment 2 Kunal Mehta (Legoktm) 2013-10-05 04:45:39 UTC
- **priority**: 5 --> 3
Comment 3 Kunal Mehta (Legoktm) 2013-10-05 04:45:41 UTC
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.
Comment 4 Mpaa 2013-10-25 16:30:43 UTC

*** This bug has been marked as a duplicate of bug 55315 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links