Bugs item #3053539, was opened at 2010-08-26 10:05 Message generated for change (Comment added) made by djbarrett You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3053539...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: category Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Daniel Barrett (djbarrett) Assigned to: Nobody/Anonymous (nobody) Summary: category.py move ignores noinclude, includeonly
Initial Comment: 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
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 11:32
Message: 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]]...
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett) Date: 2010-09-15 11:29
Message: 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]]...
----------------------------------------------------------------------
Comment By: xqt (xqt) Date: 2010-09-15 06:19
Message: Is this related to templates? Could you give me a sample.
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett) Date: 2010-09-13 15:58
Message: This bug is destructive to wiki articles. Any chance it will be addressed soon? Thanks.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3053539...
pywikipedia-bugs@lists.wikimedia.org