Page MenuHomePhabricator AttributeError: 'function' object has no attribute 'startswith'
Closed, ResolvedPublic


sat@ubuntu-sat2:~/wikipedia/jobs/wikidata/wd_mangler$ python ~/pywikibot/core/ newitem -file:kat_trin2
Page age is set to 21 days so only pages created
before 2019-02-10T10:49:19Z will be considered.
Last edit is set to 7 days so only pages last edited
before 2019-02-24T10:49:19Z will be considered.
Traceback (most recent call last):
  File "/home/sat/pywikibot/core/", line 232, in <module>
    if not main():
  File "/home/sat/pywikibot/core/", line 225, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "/home/sat/pywikibot/core/", line 94, in run_python_file
  File "/home/sat/pywikibot/core/scripts/", line 175, in <module>
  File "/home/sat/pywikibot/core/scripts/", line 159, in main
    user = pywikibot.User(,
  File "/home/sat/pywikibot/core/pywikibot/tools/", line 1738, in wrapper
    return obj(*__args, **__kw)
  File "/home/sat/pywikibot/core/pywikibot/", line 3183, in __init__
    if title.startswith('#'):
AttributeError: 'function' object has no attribute 'startswith'
CRITICAL: Exiting due to uncaught exception <type 'exceptions.AttributeError'>

How to fix:

sat@ubuntu-sat2:~/pywikibot/core$ git diff scripts/
diff --git a/scripts/ b/scripts/
index a2f35959..9744f0f4 100755
--- a/scripts/
+++ b/scripts/
@@ -156,7 +156,7 @@ def main(*args):
         return False
     bot = NewItemRobot(generator, **options)
-    user = pywikibot.User(,
+    user = pywikibot.User(,
     if bot.getOption('touch') == 'newly' \
             and 'autoconfirmed' not in user.groups():

(tip from "valhallasw`cloud" on irc)

Event Timeline

Steenth created this task.Mar 3 2019, 2:50 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMar 3 2019, 2:50 PM
valhallasw updated the task description. (Show Details)Mar 3 2019, 3:07 PM
Restricted Application added a project: User-Zoranzoki21. · View Herald TranscriptMar 3 2019, 3:42 PM

Change 494041 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[pywikibot/core@master] Fixed AttributeError at script

Zoranzoki21 renamed this task from bug in to AttributeError: 'function' object has no attribute 'startswith'.Mar 3 2019, 3:47 PM
Xqt triaged this task as Normal priority.Mar 3 2019, 4:04 PM
Xqt closed this task as Resolved.
Zoranzoki21 reopened this task as Open.Mar 3 2019, 4:08 PM
Zoranzoki21 added a subscriber: Xqt.

@Xqt Patch wasn't merged.. Please +2 it again.

Change 494041 merged by jenkins-bot:
[pywikibot/core@master] Fixed AttributeError at script

Xqt closed this task as Resolved.Mar 3 2019, 11:17 PM