Page MenuHomePhabricator

category.py breaks articles with includeonly and noinclude
Closed, ResolvedPublic

Description

Originally from: http://sourceforge.net/p/pywikipediabot/bugs/822/
Reported by: djbarrett
Created on: 2008-11-19 19:07:20
Subject: category.py breaks articles with includeonly and noinclude
Original description:
This is a DEADLY bug that wrecks wiki structure.

I ran "python category.py" to rename one category to another. For articles containing <includeonly> and <noinclude> statements, pywikipedia made incorrect changes. When renaming category B to category C, the text:

<includeonly>\[\[Category:A\]\]</includeonly><noinclude>\[\[Category:B\]\]</noinclude>

becomes:

<includeonly></includeonly><noinclude></noinclude>
\[\[Category:C\]\]

In other words, it completely removed category A, and when renaming category B, placed the new category tag outside the noinclude tags.

This wrecked a complicated category structure.

$ python version.py
Pywikipedia \[http\] trunk/pywikipedia \(r6088, Nov 12 2008, 11:19:15\)
Python 2.4.3 \(\#1, May 24 2008, 13:57:05\)
\[GCC 4.1.2 20070626 \(Red Hat 4.1.2-14\)\]


Version: unspecified
Severity: critical
See Also:
https://sourceforge.net/p/pywikipediabot/bugs/822

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:33 AM
bzimport set Reference to bz55315.
bzimport added a subscriber: Unknown Object (????).
  • summary: category.py fails with includeonly and noinclude --> category.py breaks articles with includeonly and noinclude

Change 88885 had a related patch set uploaded by Mpaa:
Bug 55315 - category.py breaks articles with includeonly and noinclude

https://gerrit.wikimedia.org/r/88885

Change 89026 had a related patch set uploaded by Mpaa:
Bug 55315 - category.py breaks articles with includeonly and noinclude

https://gerrit.wikimedia.org/r/89026

  • Bug 55300 has been marked as a duplicate of this bug. ***
  • Bug 55221 has been marked as a duplicate of this bug. ***
  • Bug 55328 has been marked as a duplicate of this bug. ***

Change 88885 abandoned by Ladsgroup:
Bug 55315 - category.py breaks articles with includeonly and noinclude

https://gerrit.wikimedia.org/r/88885

Change 89026 had a related patch set uploaded (by John Vandenberg):
category.py breaks articles with includeonly and noinclude

https://gerrit.wikimedia.org/r/89026

Patch-For-Review

I am guessing that 'onlyinclude' has the same problem, but for some reason that has never been handled by pywikibot: T88096 .

Change 89026 merged by jenkins-bot:
category.py breaks articles with includeonly and noinclude

https://gerrit.wikimedia.org/r/89026

I think we need unit tests for this, before it is closed.

This task has "Unbreak now" priority since January 2015 which seems unrealistic. Please correct the priority value or set an assignee.

Mpaa lowered the priority of this task from Unbreak Now! to Medium.Apr 2 2015, 5:48 PM
Mpaa set Security to None.

Change 248232 had a related patch set uploaded (by Mpaa):
tests_textlib.py: add tests for replaceExcept with includeonly

https://gerrit.wikimedia.org/r/248232

Change 248232 merged by jenkins-bot:
tests_textlib.py: add tests for replaceExcept with includeonly

https://gerrit.wikimedia.org/r/248232