Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/818121 )
Change subject: [IMPR] Skip the page if it does not exist ......................................................................
[IMPR] Skip the page if it does not exist
If a page does not exist e.g. given with -page option show the right message and skip instead of printing "ERROR: Missing or malformed template in page..."
Change-Id: I941ab52d52faaf6c0373e1fc63be8c5432db4bb8 --- M scripts/archivebot.py 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: Xqt: Verified; Looks good to me, approved
diff --git a/scripts/archivebot.py b/scripts/archivebot.py index 19ab8cf..8723eb9 100755 --- a/scripts/archivebot.py +++ b/scripts/archivebot.py @@ -829,6 +829,9 @@ namespaces=ns, content=True) for pg in gen: + if not pg.exists(): + pywikibot.info('{} does not exist, skipping...'.format(pg)) + continue pywikibot.info('\n\n>>> <<lightpurple>>{}<<default>> <<<' .format(pg.title())) # Catching exceptions, so that errors in one page do not bail out
pywikibot-commits@lists.wikimedia.org