Page MenuHomePhabricator

BadTitle exception is not raised in core and should be removed
Closed, ResolvedPublic

Event Timeline

Xqt triaged this task as Low priority.Nov 12 2020, 6:13 AM

I would like to tackle this task and I would like to ask if I have to remove the BadTitle exception from all the files listed in the above link, if Yes what should go there after its removal?

@Xqt What should be done here?

@Homeboy_445: Just remove the exception handling arround this exception e.g.

try:
    page = pywikibot.Page(site, title)
except pywikibot.BadTitle:
    # The interwiki was incorrect
    break
except OtherException
    do_whatever()

should become

try:
    page = pywikibot.Page(site, title)
except OtherException
    do_whatever()

Alright! I'm on it and will let you know soon as I'm done!

@Xqt Just one more thing! Do I have to alter the same for every exception or just this one. Thanks for your help!

@Xqt Just one more thing! Do I have to alter the same for every exception or just this one. Thanks for your help!

This is only a sample but you should change the real code accordingly. Fix one file after another.

Change 642031 had a related patch set uploaded (by Xqt; owner: Homeboy 445):
[pywikibot/core@master] Removed the BadTitle Exception from certain files

https://gerrit.wikimedia.org/r/642031

Xqt reassigned this task from Xqt to Homeboy_445.

Change 642031 merged by Xqt:
[pywikibot/core@master] Removed the BadTitle Exception from certain files

https://gerrit.wikimedia.org/r/642031

Change 676607 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [cleanup] Remove BadTitle exception

https://gerrit.wikimedia.org/r/676607

Change 676607 merged by jenkins-bot:

[pywikibot/core@master] [cleanup] Remove BadTitle exception

https://gerrit.wikimedia.org/r/676607