Page MenuHomePhabricator

cosmetic changes cannot import name Category
Closed, InvalidPublic

Description

running interwiki bot with cosmetic:changes enabled (for cs:, disabled for de: in this example) causes bot crash. With disabled cosmetic:changes it works correctly:

interwiky.py -family:wiktionary -lang:sk jídlo
....

Post-processing [[sk:jídlo]]

Updating links on page [[de:jídlo]].
Changes to be made: Robot: Přidávám [[chr:jídlo]], [[sk:jídlo]]
+ [[chr:jídlo]]
+ [[sk:jídlo]]

NOTE: Updating live wiki... Updating page [[de:jídlo]] via API Updating links on page [[cs:jídlo]]. Changes to be made: Robot: Přidávám [[chr:jídlo]], [[sk:jídlo]] + [[chr:jídlo]] + [[sk:jídlo]]
NOTE: Updating live wiki... Dump sk (wiktionary) appended. Traceback (most recent call last): File "I:\py\interwiki.py", line 2658, in <module> main() File "I:\py\interwiki.py", line 2632, in main bot.run() File "I:\py\interwiki.py", line 2350, in run self.queryStep() File "I:\py\interwiki.py", line 2328, in queryStep subj.finish() File "I:\py\interwiki.py", line 1766, in finish if self.replaceLinks(page, new): File "I:\py\interwiki.py", line 2007, in replaceLinks comment=mcomment) File "I:\py\wikipedia.py", line 2222, in put newtext = ccToolkit.change(newtext) File "I:\py\cosmetic_changes.py", line 157, in change text = self.standardizePageFooter(text) File "I:\py\cosmetic_changes.py", line 251, in standardizePageFooter categories = pywikibot.getCategoryLinks(text, site=self.site) File "I:\py\pywikibot\textlib.py", line 639, in getCategoryLinks import catlib File "I:\py\pywikibot\catlib.py", line 17, in <module> from pywikibot import Category ImportError: cannot import name Category

I:\py>


Version: compat-(1.0)
Severity: normal

Details

Reference
bz59790

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:27 AM
bzimport set Reference to bz59790.

You are running core scripts on compat branch. Your catlib is from core but the remaining scripts looks like compat. Please validate your framework. There shouldn't be a catlib.py in the pywikibot folder on compat.

It's possible, because words *Co*re and *Co*mpat are more similar than Trunk and Rewrite and when migrating on new computer, I mixed these frameworks together. Thank for hint, I'll check it