Page MenuHomePhabricator

weblinkchecker.py: TypeError: 'unicode' object is not callable
Closed, ResolvedPublic

Description

When running weblinkchecker.py on a wiki I contribute to, it crashes consistently.

Output of pwb.py verseion

[phuzion@phuzion01 core]$ python pwb.py version
Pywikibot: [https] r-p-pywikibot-core (7ea6fba, g10387, 2018/11/05, 17:45:43, ok)
Release version: 3.1.dev0
requests version: 2.7.0
  cacerts: /home/phuzion/.local/lib/python2.7/site-packages/certifi/cacert.pem
    certificate test: ok
Python: 2.7.15 (default, May 15 2018, 15:37:31)
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]
PYWIKIBOT_DIR: Not set
PYWIKIBOT_DIR_PWB:
PYWIKIBOT_NO_USER_CONFIG: Not set
Config base dir: /home/phuzion/code/remywikibot/core
Usernames for family "Remywiki":
        en: PhuzBot (no sysop configured)

Output of traceback

[phuzion@phuzion01 core]$ ./pwb.py weblinkchecker -start:!
Retrieving 240 pages from Remywiki:en.
WARNING: API warning (query): Too many values supplied for parameter "titles". The limit is 50.
WARNING: API warning (main): Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.


>>> "Schall" we step? <<<

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

ERROR: TypeError: 'unicode' object is not callable
Saving history...
Traceback (most recent call last):
  File "./pwb.py", line 257, in <module>
    if not main():
  File "./pwb.py", line 250, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "./pwb.py", line 119, in run_python_file
    main_mod.__dict__)
  File "./scripts/weblinkchecker.py", line 1055, in <module>
    main()
  File "./scripts/weblinkchecker.py", line 1017, in main
    bot.run()
  File "/home/phuzion/code/remywikibot/core/pywikibot/bot.py", line 1505, in run
    self.treat(page)
  File "/home/phuzion/code/remywikibot/core/pywikibot/bot.py", line 1732, in treat
    self.treat_page()
  File "./scripts/weblinkchecker.py", line 905, in treat_page
    self.HTTPignore, self.day)
  File "./scripts/weblinkchecker.py", line 593, in __init__
    url().encode('utf-8', 'replace'))))
TypeError: 'unicode' object is not callable
<type 'exceptions.TypeError'>
CRITICAL: Closing network session.

Event Timeline

zhuyifei1999 renamed this task from Unicode traceback in weblinkchecker.py to weblinkchecker.py: TypeError: 'unicode' object is not callable.Nov 8 2018, 7:56 PM

Change 472523 had a related patch set uploaded (by Zhuyifei1999; owner: Zhuyifei1999):
[pywikibot/core@master] weblinkchecker.py: Don't call 'url', a unicode object

https://gerrit.wikimedia.org/r/472523

This is a Regression from 482a453. CC @D3r1ck01.

Yup, :(

Change 472523 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] weblinkchecker.py: Don't call 'url', a unicode object

https://gerrit.wikimedia.org/r/472523

Xqt assigned this task to zhuyifei1999.
Xqt triaged this task as High priority.