--- ValBot/Python/check_interwiki_links.py 2025/09/21 21:50:56 1198 +++ ValBot/Python/check_interwiki_links.py 2025/09/29 18:15:05 1199 @@ -100,13 +100,13 @@ def find_canonical_link(the_link): canonical_name = canonical_name[:tag_end] if len(canonical_name) > 100: # Certain things can cause the trim to fail; report error and avoid slamming the output with massive page source from a failed trim - pywikibot.stdout(' ERROR: The {0} link "{1}" is a redirect to "{2}…" (string overflow).'.format(the_link.iw_prefix, the_link.page_slug, canonical_name[:100])) + pywikibot.stdout(' ERROR: The {0} link "{1}" is a redirect to "{2}..." (string overflow).'.format(the_link.iw_prefix, the_link.page_slug, canonical_name[:100])) errors_issued = errors_issued + 1 else: the_link.page_name = canonical_name.replace('_', ' ') if '#' in the_link.page_slug: the_link.page_name_only, _ = the_link.page_slug.split('#') - pywikibot.stdout(' The {0} link "{1}" is a redirect to "{2}", which is a valid page. Checking for section on that page….'.format(the_link.iw_prefix, the_link.page_name_only, the_link.page_name)) + pywikibot.stdout(' The {0} link "{1}" is a redirect to "{2}", which is a valid page. Checking for section on that page....'.format(the_link.iw_prefix, the_link.page_name_only, the_link.page_name)) find_section(the_link, True) else: pywikibot.stdout(' The {0} link "{1}" is a redirect to "{2}", which is a valid page.'.format(the_link.iw_prefix, the_link.page_slug, the_link.page_name)) @@ -125,14 +125,14 @@ def test_interwiki_link(the_link): # If linked page is in all caps, e.g. WP:BEANS, it's likely a deliberate use of a redirect if the_link.page_slug.startswith('WP:') and the_link.page_slug == the_link.page_slug.upper(): - pywikibot.stdout(' Got redirection code "{0}" for {1} link "{2}". This appears to be a deliberate use of a Wikipedia shortcut. Checking the target page….'.format(the_link.curl_response.history[0], the_link.iw_prefix, the_link.page_slug)) + pywikibot.stdout(' Got redirection code "{0}" for {1} link "{2}". This appears to be a deliberate use of a Wikipedia shortcut. Checking the target page....'.format(the_link.curl_response.history[0], the_link.iw_prefix, the_link.page_slug)) find_canonical_link(the_link) else: permalink1 = 'Special:PermanentLink/'.lower() permalink2 = 'Special:Permalink/'.lower() page_slug_lower = the_link.page_slug.lower() if page_slug_lower.startswith(permalink1) or page_slug_lower.startswith(permalink2): - pywikibot.stdout(' Got redirection code "{0}" for {1} permanent revision link "{2}". Checking the target page….'.format(the_link.curl_response.history[0], the_link.iw_prefix, the_link.page_slug)) + pywikibot.stdout(' Got redirection code "{0}" for {1} permanent revision link "{2}". Checking the target page....'.format(the_link.curl_response.history[0], the_link.iw_prefix, the_link.page_slug)) find_canonical_link(the_link) else: pywikibot.stdout(' ERROR: Unrecognized type of redirection (code "{0}") for {1} link "{2}". You should check the link manually.'.format(the_link.curl_response.history[0], the_link.iw_prefix, the_link.page_slug)) @@ -147,7 +147,7 @@ def test_interwiki_link(the_link): elif 'Redirected from