Page MenuHomePhabricator

textlib.categoryFormat() only works for site specified by config or command line
Closed, ResolvedPublic

Description

textlib.categoryFormat() only works when the categories are on the same site as config.family/config.mylang

The breakage was introduced with:

https://gerrit.wikimedia.org/r/#/c/147845/

Which caused the ar:wikipedia and test:wikidata travis builds to break
https://travis-ci.org/wikimedia/pywikibot-core/jobs/30527485

FAIL: test_category_format_Page (__main__.TestFormatFunctions)

Traceback (most recent call last):

File "tests/textlib_tests.py", line 130, in test_category_format_Page
  textlib.categoryFormat(data, self.site))

AssertionError: u'[[Category:Cat1]]\n[[Category:Cat2]]\n' != u'[[en:Category:Cat1]]\n[[en:Category:Cat2]]\n'

  • [[Category:Cat1]]

+ [[en:Category:Cat1]]
? +++

  • [[Category:Cat2]]

+ [[en:Category:Cat2]]
? +++

I have tested both of these proposed changes, and neither fixes this breakage:
https://gerrit.wikimedia.org/r/#/c/147860/
https://gerrit.wikimedia.org/r/#/c/148553/


Version: core-(2.0)
Severity: critical

Details

Reference
bz68564

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:33 AM
bzimport set Reference to bz68564.

Change 149455 had a related patch set uploaded by Ricordisamoa:
convert non-string items to Category objects in textlib.categoryFormat()

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

Change 149455 merged by jenkins-bot:
convert non-string items to Category objects in textlib.categoryFormat()

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

the patch merged and the tests seems okay on this. I close this bug, feel free to reopen if you think it still happens