Page MenuHomePhabricator fails on python3 when there are non-ascii characters in wikitext
Closed, ResolvedPublic


$  python3 piper -filter:"tr A-Z a-z" -page:"Arabic diacritics" -simulate -family:wikipedia -lang:en
Retrieving 1 pages from wikipedia:en.

>>> Arabic diacritics <<<

0 pages read
0 pages written
Execution time: 0 seconds
Script terminated by exception:

ERROR: TypeError: Template.append: cmd must be a string
Traceback (most recent call last):
  File "", line 256, in <module>
    if not main():
  File "", line 250, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "", line 121, in run_python_file
  File "./scripts/", line 159, in <module>
  File "./scripts/", line 151, in main
  File "/mnt/nfs/labstore-secondary-tools-project/dbbot/.pywikibot/pywikibot/", line 1594, in run
    super(MultipleSitesBot, self).run()
  File "/mnt/nfs/labstore-secondary-tools-project/dbbot/.pywikibot/pywikibot/", line 1408, in run
  File "/mnt/nfs/labstore-secondary-tools-project/dbbot/.pywikibot/pywikibot/", line 1695, in treat
    super(ExistingPageBot, self).treat(page)
  File "/mnt/nfs/labstore-secondary-tools-project/dbbot/.pywikibot/pywikibot/", line 1759, in treat
    super(NoRedirectPageBot, self).treat(page)
  File "/mnt/nfs/labstore-secondary-tools-project/dbbot/.pywikibot/pywikibot/", line 1622, in treat
  File "./scripts/", line 113, in treat_page
    text = self.pipe(program, text)
  File "./scripts/", line 91, in pipe
    pipe.append(program.encode('ascii'), '--')
  File "/mnt/nfs/labstore-secondary-tools-project/dbbot/.python/360/lib/python3.6/", line 113, in append
    raise TypeError('Template.append: cmd must be a string')
TypeError: Template.append: cmd must be a string
<class 'TypeError'>
CRITICAL: Closing network session.


Related Gerrit Patches:

Event Timeline

Dalba created this task.Feb 5 2017, 11:30 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptFeb 5 2017, 11:30 AM

Change 337224 had a related patch set uploaded (by Mpaa): fix bytes/str handling in python3

Change 337224 merged by Xqt:
[pywikibot/core@master] fix bytes/str handling in python3

Mpaa closed this task as Resolved.Jun 19 2017, 7:58 PM
Mpaa claimed this task.