Page MenuHomePhabricator

makecat does not work with command line arguments
Closed, ResolvedPublic


When the category name is put on the command line in Linux

$ python scripts/ -family:wikipedia -lang:en Roads_in_Kent
Traceback (most recent call last):

File "", line 157, in <module>
  run_python_file(fn, argv, argvu)
File "", line 67, in run_python_file
  exec(compile(source, filename, "exec"), main_mod.__dict__)
File "scripts/", line 217, in <module>
  workingcatname = unicode(workingcatname, 'utf-8')

TypeError: decoding Unicode is not supported
<type 'exceptions.TypeError'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort

It works correctly if the category name is entered via pywikibot.input()

$ python scripts/ -family:wikipedia -lang:en
Which page to start with? Roads_in_Kent

WARNING: unicode.setAction is DEPRECATED, use comment parameter for page saving method instead. Retrieving 32 pages from wikipedia:en. Retrieving 50 pages from wikipedia:en.

Roy Phippen


Version: core-(2.0)
Severity: major
OS: Linux
Platform: PC



Event Timeline

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

Im guessing the 'unicode(workingcatname, 'utf-8')' was put in there for a reason; probably some other issue wrt pywikibot.input or command line argument handling.

I see it wasnt using pywikibot.input, which is why casting to unicode was needed.