Last modified: 2014-08-04 03:14:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T71060, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69060 - makecat does not work with command line arguments
makecat does not work with command line arguments
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
PC Linux
: Unprioritized major
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks: pwb_script_tests
  Show dependency treegraph
 
Reported: 2014-08-03 02:57 UTC by John Mark Vandenberg
Modified: 2014-08-04 03:14 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description John Mark Vandenberg 2014-08-03 02:57:27 UTC
When the category name is put on the command line in Linux

$ python pwb.py scripts/makecat.py -family:wikipedia -lang:en Roads_in_Kent
Traceback (most recent call last):
  File "pwb.py", line 157, in <module>
    run_python_file(fn, argv, argvu)
  File "pwb.py", line 67, in run_python_file
    exec(compile(source, filename, "exec"), main_mod.__dict__)
  File "scripts/makecat.py", 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 pwb.py scripts/makecat.py -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==
....
Comment 1 John Mark Vandenberg 2014-08-03 02:58:50 UTC
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.
Comment 2 John Mark Vandenberg 2014-08-03 03:56:18 UTC
I see it wasnt using pywikibot.input, which is why casting to unicode was needed.

https://gerrit.wikimedia.org/r/#/c/151375/3

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links