https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
Web browser: --- Bug ID: 55260 Summary: category.py move ignores noinclude, includeonly Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: category.py Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: legoktm.wikipedia@gmail.com Classification: Unclassified Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1232/ Reported by: djbarrett Created on: 2010-08-26 14:05:12 Subject: category.py move ignores noinclude, includeonly Original description: When running "python category.py move", if the old category is enclosed in <noinclude> or <includeonly> tags, the new, replaced category is not, which is a problem. For example, this construction:
<includeonly>[[Category:Foo]]</includeonly>
when operated on by:
python category.py move -from:"Foo" -to:"Bar"
produces:
<includeonly></includeonly> [[Category:Bar]]
which is wrong.
This bug has existed for a long time, at least a few years.
$ python version.py Python 2.4.3 (#1, Sep 3 2009, 15:37:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] config-settings: use_api = True use_api_login = True
$ svn info Revision: 8319
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- - **labels**: --> category
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
--- Comment #2 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- This bug is destructive to wiki articles. Any chance it will be addressed soon? Thanks.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
--- Comment #3 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Is this related to templates? Could you give me a sample.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
--- Comment #4 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Yes, it's related to templates. Here is a test case.
1. Create "Template:Pywikipedia test" containing:
Hello.<includeonly>[[Category:AABBCC]]</includeonly>
2. Create an article "test" containing:
{{pywikipedia test}}
3. Run: $ python category.py move -from:"AABBCC" -to:"DD"
The output shows that Pywikipedia gets confused and can't modify the category tag inside the template:
Target page Category:DD already exists! Getting [[Category:AABBCC]]... Getting 1 pages from vistawiki:en... ERROR: [[Test]] is not in category Category:AABBCC! Getting [[Category:AABBCC]]...
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
--- Comment #5 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Here is an even worse example. Just like in the previous example, create "Template:Pywikipedia test", but this time, make its contents:
Hello.<noinclude>[[Category:AABBCC]]</noinclude><includeonly>[[Category:EE]]</includeonly>
Again, make the article "Test" contain:
{{pywikipedia test}}
Now run:
$ python category.py move -from:"AABBCC" -to:"DD"
In this case, "Template:Pywikipedia test" gets modified completely wrong to become:
Hello.<noinclude></noinclude><includeonly> </includeonly>
[[Category:DD]]
So the category tag for "EE" vanishes completely, and "DD" gets moved outside of the "noinclude" tags.
Piwikipedia's output for this command was:
$ python category.py move -from:"AABBCC" -to:"DD" Target page Category:DD already exists! Getting [[Category:AABBCC]]... Getting 1 pages from vistawiki:en... Sleeping for 5.8 seconds, 2010-09-15 11:28:53 Updating page [[Template:Pywikipedia test]] via API Getting [[Category:AABBCC]]...
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
--- Comment #6 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Note: bug 3066934 may block you from testing this. r8562 introduced a fatal bug in category.py.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
--- Comment #7 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Bug 3066934 is no longer blocking this bug from being fixed.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
--- Comment #8 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Any chance this will be fixed? It causes articles to be modified in bad ways. Thanks.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://sourceforge.net/p/p | |ywikipediabot/bugs/1232
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
Amir Ladsgroup ladsgroup@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Priority|Unprioritized |Normal Status|NEW |RESOLVED CC| |ladsgroup@gmail.com Resolution|--- |INVALID
--- Comment #9 from Amir Ladsgroup ladsgroup@gmail.com --- I tested it and It worked correctly http://fa.wikipedia.org/w/index.php?title=%D8%A7%D9%84%DA%AF%D9%88:Pywikibot...
It's probably fixed during these years
https://bugzilla.wikimedia.org/show_bug.cgi?id=55260
Amir Ladsgroup ladsgroup@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED
pywikipedia-bugs@lists.wikimedia.org