Page MenuHomePhabricator uses clear() method available only in Python 3.3
Closed, ResolvedPublic

Description crashes when run on python 2.7 due to usage of python 3.3 only method:

$> python harvest_template -lang:pl -namespace:0 -template:"Biogram infobox" -islink 'miejsce urodzenia' P19 'miejsce śmierci' P20 'data urodzenia' P569 'data śmierci' P570 -pt:15
Traceback (most recent call last):
  File "", line 262, in <module>
    if not main():
  File "", line 255, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "", line 121, in run_python_file
  File "./scripts/", line 386, in <module>
  File "./scripts/", line 357, in main
AttributeError: 'list' object has no attribute 'clear'
<type 'exceptions.AttributeError'>
CRITICAL: Closing network session.

$ python version
Pywikibot: [https] r-pywikibot-core (f07e4bb, g8564, 2017/08/27, 22:45:37, n/a)
Release version: 3.0-dev
requests version: 2.6.0
  cacerts: /etc/pki/tls/certs/ca-bundle.crt
    certificate test: ok
Python: 2.7.5 (default, Aug  2 2016, 04:20:16) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]

Event Timeline

Dalba triaged this task as High priority.
Dalba updated the task description. (Show Details)

Change 375376 had a related patch set uploaded (by Dalba; owner: Dalba):
[pywikibot/core@master] Do not use list.clear which is python 3 only

Change 375376 merged by jenkins-bot:
[pywikibot/core@master] Do not use list.clear which is python 3 only

Thanks to Strainu for reviewing it so fast.