Steenth created this task.
Steenth added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  sat@ubuntu-sat2:~/wikipedia/jobs/wikidata/wd_mangler$ python 
~/pywikibot/core/pwb.py 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/pwb.py", line 232, in <module>
      if not main():
    File "/home/sat/pywikibot/core/pwb.py", line 225, in main
      run_python_file(filename, [filename] + args, argvu, file_package)
    File "/home/sat/pywikibot/core/pwb.py", line 94, in run_python_file
      main_mod.__dict__)
    File "/home/sat/pywikibot/core/scripts/newitem.py", line 175, in <module>
      main()
    File "/home/sat/pywikibot/core/scripts/newitem.py", line 159, in main
      user = pywikibot.User(bot.site, bot.site.username)
    File "/home/sat/pywikibot/core/pywikibot/tools/__init__.py", line 1738, in 
wrapper
      return obj(*__args, **__kw)
    File "/home/sat/pywikibot/core/pywikibot/page.py", 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/newitem.py
  diff --git a/scripts/newitem.py b/scripts/newitem.py
  index a2f35959..9744f0f4 100755
  
  - a/scripts/newitem.py
  
  +++ b/scripts/newitem.py
  @@ -156,7 +156,7 @@ def main(*args):
  
        return False
     
    bot = NewItemRobot(generator, **options)
  
  - user = pywikibot.User(bot.site, bot.site.username)
  
  +    user = pywikibot.User(bot.site, bot.site.username())
  
    if bot.getOption('touch') == 'newly' \
            and 'autoconfirmed' not in user.groups():
        pywikibot.warning(fill(
  
  (tip from "valhallasw`cloud" on irc)

TASK DETAIL
  https://phabricator.wikimedia.org/T217513

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Steenth
Cc: Aklapper, pywikibot-bugs-list, Steenth, Wenyi, Tbscho, MayS, Mdupont, 
JJMC89, Avicennasis, mys_721tx, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to