Page MenuHomePhabricator

importerror catlib for interwiki.py
Closed, InvalidPublic

Description

D:\Py\rewrite>pwb.py interwiki -family:wiktionary -cleanup -start:category:Finština -array:50 -query:30 -untranslated

Traceback (most recent call last):

File "D:\Py\rewrite\pwb.py", line 178, in <module>
  run_python_file(fn, argv, argvu)
File "D:\Py\rewrite\pwb.py", line 75, in run_python_file
  exec(compile(source, filename, "exec"), main_mod.__dict__)
File "interwiki.py", line 357, in <module>
  from pywikibot import catlib

ImportError: cannot import name catlib
<type 'exceptions.ImportError'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort

D:\Py\rewrite>


Version: core-(2.0)
Severity: critical

Details

Reference
bz72669

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 4:00 AM
bzimport set Reference to bz72669.
bzimport added a subscriber: Unknown Object (????).

That doesn't make sense. I can't find any catlib reference in the current version of the repository:

https://github.com/wikimedia/pywikibot-core/search?utf8=%E2%9C%93&q=catlib

As you can see also line 357 doesn't contain a catlib entry:

https://github.com/wikimedia/pywikibot-core/blob/master/scripts/interwiki.py#L357

That statement:

  1. never has existed in core, as catlib doesn't exist there,
  2. has been removed in compat in this revision: https://github.com/wikimedia/pywikibot-compat/commit/fcaa349e54e7850e555b878d7b9f5aa0b6edbd7c

So you probably copied an ancient revision of compat interwiki.py into d:\py\rewrite or d:\py\rewrite\scripts.

A bit of nitpick: In core is a catlib.py in pywikibot/compat/catlib.py. But it is just there for backwards compatibility and isn't used by anything (git grep catlib).

(In reply to Merlijn van Deen from comment #2)

That statement:

  1. never has existed in core, as catlib doesn't exist there,
  2. has been removed in compat in this revision:

https://github.com/wikimedia/pywikibot-compat/commit/
fcaa349e54e7850e555b878d7b9f5aa0b6edbd7c

So you probably copied an ancient revision of compat interwiki.py into
d:\py\rewrite or d:\py\rewrite\scripts.

I found duplicate old interwiki.py in the same directory as pwb.py - bot takes this first instead of scripts/interwiki.py

Now I can run script, but some new errors.