https://bugzilla.wikimedia.org/show_bug.cgi?id=58084
Web browser: --- Bug ID: 58084 Summary: "category.py move" adds categories from transcluded templates. Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: category.py Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: cdpark@gmail.com Classification: Unclassified Mobile Platform: ---
When moving category using "python category.py move -from:XX -to:YY", it does not work properly.
It adds categories from transcluded templates.
For example, [https://ko.wikipedia.org/w/index.php?title=%EC%96%91%ED%8F%89_%EC%9A%A9%EB%A... This edit] adds "[[분류:경기도에 관한 토막글]]"(means"Category:Gyeonngi-do stubs"). This category comes from the transcluded template "{{토막글|경기도}}".
The function "page.categories()" of pywikibot-core differs from pywikibot-compat's.
The "category.py" in pywikibot-compat works well.
https://bugzilla.wikimedia.org/show_bug.cgi?id=58084
Ricordisamoa ricordisamoa@live.it changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ricordisamoa@live.it
--- Comment #1 from Ricordisamoa ricordisamoa@live.it --- So I suppose it should be using textlib to extract categories from wikicode? Or there is a nicer way?
https://bugzilla.wikimedia.org/show_bug.cgi?id=58084
Strainu crangasi2001@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |crangasi2001@yahoo.com, | |siebrand@wikimedia.org Assignee|Pywikipedia-bugs@lists.wiki |crangasi2001@yahoo.com |media.org | Severity|normal |major
--- Comment #2 from Strainu crangasi2001@yahoo.com --- I've looked a bit into this bug today as one of my robots made such a mistake too. The person who noticed the problem (commons user Denniss) said that he reported the problem to Siebrand and SieBot was fixed, so adding him to the CC list in the hope that he might have a working solution that is not yet upstream.
The problems seems to be the page.categories function, which returns all the categories, including the ones from templates. Instead, the getCategoryLinks function should be used in page.change_category. This does not currently happen neither in compat nor core, so not sure how can compat work correctly.
I will make and test a patch later on this week if nobody has a working solution.
pywikipedia-bugs@lists.wikimedia.org