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

       Web browser: ---
            Bug ID: 58976
           Summary: PreloadingItemGenerator crashes with NoPage exception
           Product: Pywikibot
           Version: core (2.0)
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Wikidata
          Assignee: pywikipedia-b...@lists.wikimedia.org
          Reporter: maar...@mdammers.nl
    Classification: Unclassified
   Mobile Platform: ---

The PreloadingItemGenerator does what the name suggests: Preload Wikidata items
so that these can be processed quickly.

When it encounters an item that has been deleted it crashes with a
"pywikibot.exceptions.NoPage: Page [[wikidata:-1]] doesn't exist." exception. 

It shouldn't crash. It should either:
* Not preload the item and pass the empty item (and let downstream check)
* Skip the item

Probably best to have the same behavior as with the PreloadingPageGenerator (or
does that one crash too?)

Full trace:

Traceback (most recent call last):
  File "C:\pywikibot\core\cc_to_sitelinks.py", line 131, in <module>
    main()
  File "C:\pywikibot\core\cc_to_sitelinks.py", line 128, in main
    bot.run()
  File "C:\pywikibot\core\cc_to_sitelinks.py", line 31, in run
    for item in self.generator:
  File "C:\pywikibot\core\pywikibot\pagegenerators.py", line 890, in
PreloadingI
temGenerator
    for i in site.preloaditempages(group, step):
  File "C:\pywikibot\core\pywikibot\site.py", line 3625, in preloaditempages
    item.get()  # parses json and preloads the various properties
  File "C:\pywikibot\core\pywikibot\page.py", line 2592, in get
    super(ItemPage, self).get(force=force, *args)
  File "C:\pywikibot\core\pywikibot\page.py", line 2421, in get
    raise pywikibot.NoPage(self)
pywikibot.exceptions.NoPage: Page [[wikidata:-1]] doesn't exist.

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

Reply via email to