HomePhabricator

Use `InvalidTitleError` instead of `InvalidTitle` in property_statistics.py

Tags
None
Referenced Files
None
Subscribers
None

Description

Use InvalidTitleError instead of InvalidTitle in property_statistics.py

It turns out this exception was renamed in cf630158c5 [1],
and released as part of pywikibot 6.6.2.

As we upgraded from 6.6.1 to 7.2.0 in d395b4cec,
we were now hitting the following exception:

AttributeError: module 'pywikibot.exceptions' has no attribute 'InvalidTitle'
  • Add unit test test_make_stats_for_one_grouping_with_grouping_link_failure which tests the exception raising and the logging, and would have caught this
  • Catch InvalidTitleError instead of InvalidTitle.

[1] https://github.com/wikimedia/pywikibot/commit/cf630158c523136c19a53370ba5df3f5953153c0

Bug: T309861

Details

Provenance
JeanFredAuthored on Jun 3 2022, 12:24 PM
Parents
R2566:3a675b6a1d12: Split-extract `retrieve_and_process_data` into two methods
Branches
Unknown
Tags
Unknown
ChangeId
None

Event Timeline