Page MenuHomePhabricator

module 'pywikibot.exceptions' has no attribute 'InvalidTitle'
Closed, ResolvedPublic

Description

Trying to update eg https://www.wikidata.org/wiki/Wikidata:WikiProject_Video_games/Statistics/Date_of_publication_(classic) :

File "./property_statistics.py", line 342, in make_stats_for_one_grouping group_item = pywikibot.ItemPage(self.repo, grouping)

File "/data/project/integraality/www/python/venv/lib/python3.7/site-packages/pywikibot/page/_wikibase.py", line 758, in __init__ super().__init__(site, title, ns=ns)

File "/data/project/integraality/www/python/venv/lib/python3.7/site-packages/pywikibot/page/_wikibase.py", line 498, in __init__ self._link.title)

File "/data/project/integraality/www/python/venv/lib/python3.7/site-packages/pywikibot/page/_wikibase.py", line 101, in __init__ .format(self.id, self.entity_type))

pywikibot.exceptions.InvalidTitleError: '2021' is not a valid item page title

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/data/project/integraality/www/python/src/app.py", line 29, in update processor.process_one_page(page_title)

File "./pages_processor.py", line 168, in process_one_page self.process_page(page)

File "./pages_processor.py", line 111, in process_page output = stats.retrieve_and_process_data()

File "/data/project/integraality/www/python/venv/lib/python3.7/site-packages/statsd/client/timer.py", line 38, in _wrapped return f(*args, **kwargs)

File "./property_statistics.py", line 384, in retrieve_and_process_data text = self.process_data(groupings_counts, groupings_groupings)

File "./property_statistics.py", line 409, in process_data text += self.make_stats_for_one_grouping(grouping, item_count, higher_grouping)

File "./property_statistics.py", line 345, in make_stats_for_one_grouping except (pywikibot.exceptions.InvalidTitle, KeyError):

AttributeError: module 'pywikibot.exceptions' has no attribute 'InvalidTitle'