https://bugzilla.wikimedia.org/show_bug.cgi?id=72305

            Bug ID: 72305
           Summary: Wikidata scripts fail badly when the default site is
                    not a client
           Product: Pywikibot
           Version: core (2.0)
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: Unprioritized
         Component: Wikidata
          Assignee: [email protected]
          Reporter: [email protected]
       Web browser: ---
   Mobile Platform: ---

newitem fails within the script.
harvest_template, coordinate_import, claimit & illustrate_wikidata fail within
the WikidataBot class, method cacheSources.

$ python pwb.py scripts/newitem.py -newpages
Traceback (most recent call last):
  File "pwb.py", line 175, in <module>
    run_python_file(fn, argv, argvu)
  File "pwb.py", line 69, in run_python_file
    exec(compile(source, filename, "exec"), main_mod.__dict__)
  File "scripts/newitem.py", line 147, in <module>
    main()
  File "scripts/newitem.py", line 143, in main
    bot = NewItemRobot(generator, **options)
  File "scripts/newitem.py", line 52, in __init__
    self.pageAgeBefore = self.repo.getcurrenttime() -
timedelta(days=self.pageAge)
AttributeError: 'NoneType' object has no attribute 'getcurrenttime'
<type 'exceptions.AttributeError'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort


$ python pwb.py scripts/harvest_template.py -newpages -template:noun
-family:wiktionary -lang:fr
Traceback (most recent call last):
  File "pwb.py", line 175, in <module>
    run_python_file(fn, argv, argvu)
  File "pwb.py", line 69, in run_python_file
    exec(compile(source, filename, "exec"), main_mod.__dict__)
  File "scripts/harvest_template.py", line 224, in <module>
    main()
  File "scripts/harvest_template.py", line 220, in main
    bot = HarvestRobot(generator, template_title, fields)
  File "scripts/harvest_template.py", line 61, in __init__
    self.cacheSources()
  File ".../pywikibot/bot.py", line 1066, in cacheSources
    page = pywikibot.Page(self.repo, u'List of wikis/python', ns=4)
  File ".../pywikibot/tools.py", line 529, in wrapper
    return obj(*__args, **__kw)
  File ".../pywikibot/page.py", line 127, in __init__
    % (type(source), source))
pywikibot.exceptions.Error: Invalid argument type '<type 'NoneType'>' in Page
constructor: None
<class 'pywikibot.exceptions.Error'>

$ python pwb.py scripts/coordinate_import.py -newpages
<same>

<etc>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to