Huji created this task.
Huji added projects: Pywikibot-category.py, Pywikibot-textlib.py.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION

Today I noticed that when category.py tries to move this template from one category to another, it failed with a nasty InvalidTitle error message. My investigations showed it occurs because the template's Doc page currently contains this wikicode:

[[رده:فیلم‌های زبان {{#invoke:string|replace|{{{زبان}}}|%[%[([^%[%]]*) [%(]?زبان[%)]?{{!}}[^%[%]]*%]%]|%1|plain=false}}]]

To make it easier to understand for our LTR-language speaking developers, that is akin to:

[[Category:movies in {{#invoke:string|replace|{{{language}}}|%[%[([^%[%]]*) [%(]?language[%)]?{{!}}[^%[%]]*%]%]|%1|plain=false}}]]

Where the output would be something like [[Category:movies in English]]. But this confuses textlib.getCategoryLinks when it tries to check for a category with that name (basically, it looks for a category whose name starts with Category:movies in {{ and { is an invalid character in page titles, hence an InvalidTitle error is resulted).

The real issue is that getCategoryLinks() does not use try .. except when trying to fetch the categories.


TASK DETAIL
https://phabricator.wikimedia.org/T154309

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Huji
Cc: Aklapper, pywikibot-bugs-list, Huji
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to