jenkins-bot submitted this change.

View Change

Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
[IMPR] Update hash bang from python to python3

- python is associated with Python 2
(except with Python 3.8+ but Pywikibot supports Python 3.5.3+);
therefore change hash bang from python to python3
- add hash bang to scripts if needed, especially for test scripts
- remove hash bang from modules which aren't used as script
- remove warning message in pagegenerators.py; it is recommended to
use listpages.py instead for 14 years
- update last change year except the change was made by script

Change-Id: Ie3281d84e1dc112a12cf418a217743f64de4e190
---
M pywikibot/cosmetic_changes.py
M pywikibot/editor.py
M pywikibot/login.py
M pywikibot/pagegenerators.py
M pywikibot/scripts/generate_family_file.py
M pywikibot/scripts/generate_user_files.py
M pywikibot/scripts/shell.py
M pywikibot/scripts/version.py
M pywikibot/specialbots/__init__.py
M pywikibot/specialbots/_unlink.py
M pywikibot/specialbots/_upload.py
M pywikibot/tools/djvu.py
M scripts/add_text.py
M scripts/archive/capitalize_redirects.py
M scripts/archive/casechecker.py
M scripts/archive/catall.py
M scripts/archive/commons_link.py
M scripts/archive/create_categories.py
M scripts/archive/data_ingestion.py
M scripts/archive/disambredir.py
M scripts/archive/editarticle.py
M scripts/archive/flickrripper.py
M scripts/archive/followlive.py
M scripts/archive/freebasemappingupload.py
M scripts/archive/imagecopy.py
M scripts/archive/imagecopy_self.py
M scripts/archive/imageharvest.py
M scripts/archive/imagerecat.py
M scripts/archive/imageuncat.py
M scripts/archive/isbn.py
M scripts/archive/lonelypages.py
M scripts/archive/makecat.py
M scripts/archive/match_images.py
M scripts/archive/ndashredir.py
M scripts/archive/piper.py
M scripts/archive/selflink.py
M scripts/archive/spamremove.py
M scripts/archive/standardize_interwiki.py
M scripts/archive/states_redirect.py
M scripts/archive/surnames_redirects.py
M scripts/archive/table2wiki.py
M scripts/archive/unlink.py
M scripts/archive/wikisourcetext.py
M scripts/archivebot.py
M scripts/basic.py
M scripts/blockpageschecker.py
M scripts/category.py
M scripts/category_redirect.py
M scripts/change_pagelang.py
M scripts/checkimages.py
M scripts/claimit.py
M scripts/clean_sandbox.py
M scripts/commons_information.py
M scripts/commonscat.py
M scripts/coordinate_import.py
M scripts/cosmetic_changes.py
M scripts/delete.py
M scripts/djvutext.py
M scripts/download_dump.py
M scripts/fixing_redirects.py
M scripts/harvest_template.py
M scripts/illustrate_wikidata.py
M scripts/image.py
M scripts/imagetransfer.py
M scripts/interwiki.py
M scripts/interwikidata.py
M scripts/listpages.py
M scripts/login.py
M scripts/maintenance/cache.py
M scripts/maintenance/colors.py
M scripts/maintenance/make_i18n_dict.py
M scripts/maintenance/preload_sites.py
M scripts/maintenance/sorting_order.py
M scripts/maintenance/update_linktrails.py
M scripts/maintenance/update_script.py
M scripts/maintenance/wikimedia_sites.py
M scripts/misspelling.py
M scripts/movepages.py
M scripts/newitem.py
M scripts/noreferences.py
M scripts/nowcommons.py
M scripts/pagefromfile.py
M scripts/parser_function_count.py
M scripts/patrol.py
M scripts/protect.py
M scripts/redirect.py
M scripts/reflinks.py
M scripts/replace.py
M scripts/replicate_wiki.py
M scripts/revertbot.py
M scripts/solve_disambiguation.py
M scripts/speedy_delete.py
M scripts/template.py
M scripts/templatecount.py
M scripts/touch.py
M scripts/transferbot.py
M scripts/unusedfiles.py
M scripts/upload.py
M scripts/watchlist.py
M scripts/weblinkchecker.py
M scripts/welcome.py
M setup.py
M tests/add_text_tests.py
M tests/api_tests.py
M tests/archive/data_ingestion_tests.py
M tests/archive/disambredir_tests.py
M tests/archive/imagecopy_tests.py
M tests/archive/isbn_tests.py
M tests/archivebot_tests.py
M tests/basepage.py
M tests/basesite_tests.py
M tests/bot_tests.py
M tests/cache_tests.py
M tests/category_bot_tests.py
M tests/category_tests.py
M tests/checkimages_tests.py
M tests/collections_tests.py
M tests/cosmetic_changes_tests.py
M tests/datasite_tests.py
M tests/date_tests.py
M tests/deletionbot_tests.py
M tests/deprecation_tests.py
M tests/diff_tests.py
M tests/djvu_tests.py
M tests/dry_api_tests.py
M tests/dry_site_tests.py
M tests/echo_tests.py
M tests/edit_failure_tests.py
M tests/edit_tests.py
M tests/eventstreams_tests.py
M tests/family_tests.py
M tests/file_tests.py
M tests/fixes_tests.py
M tests/fixing_redirects_tests.py
M tests/flow_edit_tests.py
M tests/flow_tests.py
M tests/flow_thanks_tests.py
M tests/generate_family_file_tests.py
M tests/generate_user_files_tests.py
M tests/http_tests.py
M tests/i18n_tests.py
M tests/interwiki_graph_tests.py
M tests/interwiki_link_tests.py
M tests/interwikidata_tests.py
M tests/interwikimap_tests.py
M tests/l10n_tests.py
M tests/link_tests.py
M tests/linter_tests.py
M tests/logentries_tests.py
M tests/login_tests.py
M tests/mediawikiversion_tests.py
M tests/mysql_tests.py
M tests/namespace_tests.py
M tests/noreferences_tests.py
M tests/oauth_tests.py
M tests/page_tests.py
M tests/pagegenerators_tests.py
M tests/paraminfo_tests.py
M tests/patrolbot_tests.py
M tests/plural_tests.py
M tests/proofreadpage_tests.py
M tests/protectbot_tests.py
M tests/pwb/print_argv.py
M tests/pwb/print_env.py
M tests/pwb/print_locals.py
M tests/pwb/print_unicode.py
M tests/pwb_tests.py
M tests/redirect_bot_tests.py
M tests/reflinks_tests.py
M tests/replacebot_tests.py
M tests/script_tests.py
M tests/site_decorators_tests.py
M tests/site_detect_tests.py
M tests/site_tests.py
M tests/siteinfo_tests.py
M tests/sparql_tests.py
M tests/template_bot_tests.py
M tests/tests_tests.py
M tests/textlib_tests.py
M tests/thanks_tests.py
M tests/thread_tests.py
M tests/timestamp_tests.py
M tests/timestripper_tests.py
M tests/titletranslate_tests.py
M tests/tk_tests.py
M tests/token_tests.py
M tests/tools_chars_tests.py
M tests/tools_formatter_tests.py
M tests/tools_tests.py
M tests/ui_options_tests.py
M tests/ui_tests.py
M tests/update_script_tests.py
M tests/upload_tests.py
M tests/uploadbot_tests.py
M tests/uploadscript_tests.py
M tests/user_tests.py
M tests/weblinkchecker_tests.py
M tests/wikibase_edit_tests.py
M tests/wikibase_tests.py
M tests/wikistats_tests.py
M tests/xmlreader_tests.py
201 files changed, 282 insertions(+), 211 deletions(-)

diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index b3bb6f8..621da14 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -1,4 +1,3 @@
-#!/usr/bin/python
"""
This module can do slight modifications to tidy a wiki page's source code.

diff --git a/pywikibot/editor.py b/pywikibot/editor.py
index 600522c..ab1f447 100644
--- a/pywikibot/editor.py
+++ b/pywikibot/editor.py
@@ -1,7 +1,6 @@
-#!/usr/bin/python
"""Text editor class for your favourite editor."""
#
-# (C) Pywikibot team, 2004-2021
+# (C) Pywikibot team, 2004-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/pywikibot/login.py b/pywikibot/login.py
index 79782ae..5be39a1 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -1,7 +1,6 @@
-#!/usr/bin/python
"""Library to log the bot in to a wiki account."""
#
-# (C) Pywikibot team, 2003-2021
+# (C) Pywikibot team, 2003-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 96298db..65747be 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -3089,8 +3089,3 @@
page = pywikibot.Page(self.site, raw_page['title'],
int(raw_page['namespace']))
yield page
-
-
-if __name__ == '__main__': # pragma: no cover
- pywikibot.output('Pagegenerators cannot be run as script - are you '
- 'looking for listpages.py?')
diff --git a/pywikibot/scripts/generate_family_file.py b/pywikibot/scripts/generate_family_file.py
index f86e655..98a681f 100755
--- a/pywikibot/scripts/generate_family_file.py
+++ b/pywikibot/scripts/generate_family_file.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""This script generates a family file from a given URL.

This script must be invoked with the pwb wrapper script/code entry point.
diff --git a/pywikibot/scripts/generate_user_files.py b/pywikibot/scripts/generate_user_files.py
index f5d3752..16dcd10 100755
--- a/pywikibot/scripts/generate_user_files.py
+++ b/pywikibot/scripts/generate_user_files.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Script to create user-config.py.

.. versionchanged:: 7.0
diff --git a/pywikibot/scripts/shell.py b/pywikibot/scripts/shell.py
index 58143ba..46cdb3f 100755
--- a/pywikibot/scripts/shell.py
+++ b/pywikibot/scripts/shell.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Spawns an interactive Python shell and imports the pywikibot library.

diff --git a/pywikibot/scripts/version.py b/pywikibot/scripts/version.py
index 77faad0..58fbbec 100755
--- a/pywikibot/scripts/version.py
+++ b/pywikibot/scripts/version.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Script to determine the Pywikibot version (tag, revision and date).

.. versionchanged:: 7.0
diff --git a/pywikibot/specialbots/__init__.py b/pywikibot/specialbots/__init__.py
index 0af9098..9388248 100644
--- a/pywikibot/specialbots/__init__.py
+++ b/pywikibot/specialbots/__init__.py
@@ -1,7 +1,6 @@
-#!/usr/bin/python
"""Module containing special bots reusable by scripts."""
#
-# (C) Pywikibot team, 2020-2021
+# (C) Pywikibot team, 2020-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/pywikibot/specialbots/_unlink.py b/pywikibot/specialbots/_unlink.py
index a1a6157..ad79349 100644
--- a/pywikibot/specialbots/_unlink.py
+++ b/pywikibot/specialbots/_unlink.py
@@ -1,10 +1,9 @@
-#!/usr/bin/python
"""Special bot library containing BaseUnlinkBot.

Do not import classes directly from here but from specialbots.
"""
#
-# (C) Pywikibot team, 2003-2021
+# (C) Pywikibot team, 2003-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/pywikibot/specialbots/_upload.py b/pywikibot/specialbots/_upload.py
index 69d5239..20d9bb0 100644
--- a/pywikibot/specialbots/_upload.py
+++ b/pywikibot/specialbots/_upload.py
@@ -1,10 +1,9 @@
-#!/usr/bin/python
"""Special bot library containing UploadRobot.

Do not import classes directly from here but from specialbots.
"""
#
-# (C) Pywikibot team, 2003-2021
+# (C) Pywikibot team, 2003-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/pywikibot/tools/djvu.py b/pywikibot/tools/djvu.py
index 657ec11..e4f7c65 100644
--- a/pywikibot/tools/djvu.py
+++ b/pywikibot/tools/djvu.py
@@ -1,7 +1,6 @@
-#!/usr/bin/python
"""Wrapper around djvulibre to access djvu files properties and content."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/add_text.py b/scripts/add_text.py
index a0a1cf9..dfe01c4 100755
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
This is a Bot to add text to the top or bottom of a page.

diff --git a/scripts/archive/capitalize_redirects.py b/scripts/archive/capitalize_redirects.py
index 4c97651..8312f30 100755
--- a/scripts/archive/capitalize_redirects.py
+++ b/scripts/archive/capitalize_redirects.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Bot to create capitalized redirects.

diff --git a/scripts/archive/casechecker.py b/scripts/archive/casechecker.py
index 417a654..627ee6d 100755
--- a/scripts/archive/casechecker.py
+++ b/scripts/archive/casechecker.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Bot to find all pages on the wiki with mixed latin and cyrilic alphabets."""
#
# (C) Pywikibot team, 2006-2021
diff --git a/scripts/archive/catall.py b/scripts/archive/catall.py
index 10c349a..a709fe2 100755
--- a/scripts/archive/catall.py
+++ b/scripts/archive/catall.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This script shows the categories on each page and lets you change them.

diff --git a/scripts/archive/commons_link.py b/scripts/archive/commons_link.py
index b80e444..84db448 100755
--- a/scripts/archive/commons_link.py
+++ b/scripts/archive/commons_link.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Include Commons template in home wiki.

diff --git a/scripts/archive/create_categories.py b/scripts/archive/create_categories.py
index 5097594..ef3cf06 100755
--- a/scripts/archive/create_categories.py
+++ b/scripts/archive/create_categories.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
Program to batch create categories.

diff --git a/scripts/archive/data_ingestion.py b/scripts/archive/data_ingestion.py
index 1a7f8b4..2516881 100755
--- a/scripts/archive/data_ingestion.py
+++ b/scripts/archive/data_ingestion.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
A generic bot to do data ingestion (batch uploading) of photos or other files.

diff --git a/scripts/archive/disambredir.py b/scripts/archive/disambredir.py
index 2d560ff..30d14c3 100755
--- a/scripts/archive/disambredir.py
+++ b/scripts/archive/disambredir.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
User assisted updating redirect links on disambiguation pages.

diff --git a/scripts/archive/editarticle.py b/scripts/archive/editarticle.py
index 484e80b..88478c3 100755
--- a/scripts/archive/editarticle.py
+++ b/scripts/archive/editarticle.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Edit a Wikipedia article with your favourite editor.

diff --git a/scripts/archive/flickrripper.py b/scripts/archive/flickrripper.py
index 2bbb132..472c561 100755
--- a/scripts/archive/flickrripper.py
+++ b/scripts/archive/flickrripper.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
A tool to transfer flickr photos to Wikimedia Commons.

diff --git a/scripts/archive/followlive.py b/scripts/archive/followlive.py
index 5cebb48..5da4adb 100755
--- a/scripts/archive/followlive.py
+++ b/scripts/archive/followlive.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Periodically grab list of new articles and analyze to blank or flag them.

diff --git a/scripts/archive/freebasemappingupload.py b/scripts/archive/freebasemappingupload.py
index 0ee67a5..112c3e7 100755
--- a/scripts/archive/freebasemappingupload.py
+++ b/scripts/archive/freebasemappingupload.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to upload the mappings of Freebase to Wikidata.

diff --git a/scripts/archive/imagecopy.py b/scripts/archive/imagecopy.py
index 3b36af9..d4646b4 100755
--- a/scripts/archive/imagecopy.py
+++ b/scripts/archive/imagecopy.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""
Script to copy files from a local Wikimedia wiki to Wikimedia Commons.

@@ -56,7 +57,7 @@
By default the bot works on your home wiki (set in user-config)
"""
#
-# (C) Pywikibot team, 2003-2021
+# (C) Pywikibot team, 2003-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/archive/imagecopy_self.py b/scripts/archive/imagecopy_self.py
index 8a604e8..44a9b5a 100755
--- a/scripts/archive/imagecopy_self.py
+++ b/scripts/archive/imagecopy_self.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""
Script to copy self published files from English Wikipedia to Commons.

@@ -31,7 +32,7 @@
check it yourself.
"""
#
-# (C) Pywikibot team, 2003-2021
+# (C) Pywikibot team, 2003-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/archive/imageharvest.py b/scripts/archive/imageharvest.py
index 75052e5..e57d9a3 100755
--- a/scripts/archive/imageharvest.py
+++ b/scripts/archive/imageharvest.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""
Bot for getting multiple images from an external site.

@@ -17,7 +18,7 @@
-justshown Choose _only_ images shown on the page, not those linked
"""
#
-# (C) Pywikibot team, 2004-2020
+# (C) Pywikibot team, 2004-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/archive/imagerecat.py b/scripts/archive/imagerecat.py
index 8928e3a..e79e0c1 100755
--- a/scripts/archive/imagerecat.py
+++ b/scripts/archive/imagerecat.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Program to re-categorize images at commons.

diff --git a/scripts/archive/imageuncat.py b/scripts/archive/imageuncat.py
index f0225b7..ef1c52f 100755
--- a/scripts/archive/imageuncat.py
+++ b/scripts/archive/imageuncat.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Program to add uncat template to images without categories at commons.

diff --git a/scripts/archive/isbn.py b/scripts/archive/isbn.py
index 2207d28..e68f0c5 100755
--- a/scripts/archive/isbn.py
+++ b/scripts/archive/isbn.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This script reports and fixes invalid ISBN numbers.

diff --git a/scripts/archive/lonelypages.py b/scripts/archive/lonelypages.py
index 68b59ff..15eb4f3 100755
--- a/scripts/archive/lonelypages.py
+++ b/scripts/archive/lonelypages.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This is a script written to add the template "orphan" to pages.

diff --git a/scripts/archive/makecat.py b/scripts/archive/makecat.py
index fdafbc2..2d9682d 100755
--- a/scripts/archive/makecat.py
+++ b/scripts/archive/makecat.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Bot to add new or existing categories to pages.

diff --git a/scripts/archive/match_images.py b/scripts/archive/match_images.py
index 25c270c..6104271 100755
--- a/scripts/archive/match_images.py
+++ b/scripts/archive/match_images.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Program to match two images based on histograms.

diff --git a/scripts/archive/ndashredir.py b/scripts/archive/ndashredir.py
index c6cf349..8359c31 100755
--- a/scripts/archive/ndashredir.py
+++ b/scripts/archive/ndashredir.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
A script to create hyphenated redirects for n or m dash pages.

diff --git a/scripts/archive/piper.py b/scripts/archive/piper.py
index fef5ffd..ef1d7b1 100755
--- a/scripts/archive/piper.py
+++ b/scripts/archive/piper.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
This bot uses external filtering programs for munging text.

diff --git a/scripts/archive/selflink.py b/scripts/archive/selflink.py
index f842836..7f8a44e 100755
--- a/scripts/archive/selflink.py
+++ b/scripts/archive/selflink.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This bot searches for selflinks and allows removing them.

diff --git a/scripts/archive/spamremove.py b/scripts/archive/spamremove.py
index 5c36fdc..f0b01ab 100755
--- a/scripts/archive/spamremove.py
+++ b/scripts/archive/spamremove.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to remove links that are being or have been spammed.

diff --git a/scripts/archive/standardize_interwiki.py b/scripts/archive/standardize_interwiki.py
index 1ff12ed..79a8679 100755
--- a/scripts/archive/standardize_interwiki.py
+++ b/scripts/archive/standardize_interwiki.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Loop over all pages in the home wiki, standardizing the interwiki links.

diff --git a/scripts/archive/states_redirect.py b/scripts/archive/states_redirect.py
index d564921..acd812d 100755
--- a/scripts/archive/states_redirect.py
+++ b/scripts/archive/states_redirect.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Create country sub-division redirect pages.

Check if they are in the form Something, State, and if so, create a redirect
diff --git a/scripts/archive/surnames_redirects.py b/scripts/archive/surnames_redirects.py
index 9f58052..d945ebd 100755
--- a/scripts/archive/surnames_redirects.py
+++ b/scripts/archive/surnames_redirects.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Bot to create redirects based on name order.

diff --git a/scripts/archive/table2wiki.py b/scripts/archive/table2wiki.py
index 4f70d92..c509a07 100755
--- a/scripts/archive/table2wiki.py
+++ b/scripts/archive/table2wiki.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Nifty script to convert HTML-tables to MediaWiki's own syntax.

diff --git a/scripts/archive/unlink.py b/scripts/archive/unlink.py
index 3adb09f..3dc35b0 100755
--- a/scripts/archive/unlink.py
+++ b/scripts/archive/unlink.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This bot unlinks a page on every page that links to it.

diff --git a/scripts/archive/wikisourcetext.py b/scripts/archive/wikisourcetext.py
index cc6f813..6604c31 100755
--- a/scripts/archive/wikisourcetext.py
+++ b/scripts/archive/wikisourcetext.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""

This bot applies to Wikisource sites to upload text.
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index 82246de..5c12659 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
archivebot.py - discussion page archiving bot.

diff --git a/scripts/basic.py b/scripts/basic.py
index e8695da..b11b772 100755
--- a/scripts/basic.py
+++ b/scripts/basic.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
An incomplete sample script.

diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py
index 4ef04c6..45c7ba8 100755
--- a/scripts/blockpageschecker.py
+++ b/scripts/blockpageschecker.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
A bot to remove stale protection templates from pages that are not protected.

diff --git a/scripts/category.py b/scripts/category.py
index fc3cfa1..6de36bd 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to manage categories.

diff --git a/scripts/category_redirect.py b/scripts/category_redirect.py
index 67b94bc..48adf49 100755
--- a/scripts/category_redirect.py
+++ b/scripts/category_redirect.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""This bot will move pages out of redirected categories.

The bot will look for categories that are marked with a category redirect
diff --git a/scripts/change_pagelang.py b/scripts/change_pagelang.py
index 5a3c6e6..a8fb485 100755
--- a/scripts/change_pagelang.py
+++ b/scripts/change_pagelang.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This script changes the content language of pages.

diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 70c59d1..9ded779 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to check recently uploaded files.

diff --git a/scripts/claimit.py b/scripts/claimit.py
index 2435615..8ca70de 100755
--- a/scripts/claimit.py
+++ b/scripts/claimit.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
A script that adds claims to Wikidata items based on a list of pages.

diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py
index e27b729..b9098d1 100755
--- a/scripts/clean_sandbox.py
+++ b/scripts/clean_sandbox.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This bot resets a (user) sandbox with predefined text.

diff --git a/scripts/commons_information.py b/scripts/commons_information.py
index d9cdda4..1367448 100755
--- a/scripts/commons_information.py
+++ b/scripts/commons_information.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Insert a language template into the description field."""
#
# (C) Pywikibot team, 2015-2022
diff --git a/scripts/commonscat.py b/scripts/commonscat.py
index 6bb6c96..f935393 100755
--- a/scripts/commonscat.py
+++ b/scripts/commonscat.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
With this tool you can add the template {{commonscat}} to categories.

diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
index 49cb745..364e86a 100755
--- a/scripts/coordinate_import.py
+++ b/scripts/coordinate_import.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
Coordinate importing script.

diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index d7d4c04..296ea02 100755
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This module can do slight modifications to tidy a wiki page's source code.

diff --git a/scripts/delete.py b/scripts/delete.py
index dc217d1..ead90aa 100755
--- a/scripts/delete.py
+++ b/scripts/delete.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This script can be used to delete and undelete pages en masse.

diff --git a/scripts/djvutext.py b/scripts/djvutext.py
index 5fcf2f1..5c65787 100755
--- a/scripts/djvutext.py
+++ b/scripts/djvutext.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This bot uploads text from djvu files onto pages in the "Page" namespace.

diff --git a/scripts/download_dump.py b/scripts/download_dump.py
index 6d19b34..e33d4cf 100755
--- a/scripts/download_dump.py
+++ b/scripts/download_dump.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This bot downloads dump from dumps.wikimedia.org.

diff --git a/scripts/fixing_redirects.py b/scripts/fixing_redirects.py
index d0118c7..fac33f6 100755
--- a/scripts/fixing_redirects.py
+++ b/scripts/fixing_redirects.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Correct all redirect links in featured pages or only one page of each wiki.

diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index c740470..3c72f17 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
Template harvesting script.

diff --git a/scripts/illustrate_wikidata.py b/scripts/illustrate_wikidata.py
index 2429f71..1a19d41 100755
--- a/scripts/illustrate_wikidata.py
+++ b/scripts/illustrate_wikidata.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Bot to add images to Wikidata items.

diff --git a/scripts/image.py b/scripts/image.py
index 4b55d1d..73f417a 100755
--- a/scripts/image.py
+++ b/scripts/image.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This script can be used to change one image to another or remove an image.

diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py
index 4dbfcce..98743a2 100755
--- a/scripts/imagetransfer.py
+++ b/scripts/imagetransfer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to copy images to Wikimedia Commons, or to another wiki.

diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index ea51ffb..1f222fe 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to check language links for general pages.

diff --git a/scripts/interwikidata.py b/scripts/interwikidata.py
index 2b6fc90..e56a1bf 100755
--- a/scripts/interwikidata.py
+++ b/scripts/interwikidata.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to handle interwiki links based on Wikibase.

diff --git a/scripts/listpages.py b/scripts/listpages.py
index d3b5f6c..6d2aa0e 100755
--- a/scripts/listpages.py
+++ b/scripts/listpages.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
Print a list of pages, as defined by page generator parameters.

diff --git a/scripts/login.py b/scripts/login.py
index 4f4761b..6462206 100755
--- a/scripts/login.py
+++ b/scripts/login.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to log the bot in to a wiki account.

diff --git a/scripts/maintenance/cache.py b/scripts/maintenance/cache.py
index 2cb3321..91b1ad3 100755
--- a/scripts/maintenance/cache.py
+++ b/scripts/maintenance/cache.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
This script runs commands on each entry in the API caches.

diff --git a/scripts/maintenance/colors.py b/scripts/maintenance/colors.py
index aa863e2..4bd6fcf 100755
--- a/scripts/maintenance/colors.py
+++ b/scripts/maintenance/colors.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Utility to show pywikibot colors."""
#
# (C) Pywikibot team, 2016-2020
diff --git a/scripts/maintenance/make_i18n_dict.py b/scripts/maintenance/make_i18n_dict.py
index 9fe0f56..40a9cc1 100755
--- a/scripts/maintenance/make_i18n_dict.py
+++ b/scripts/maintenance/make_i18n_dict.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Generate an i18n file from a given script.

diff --git a/scripts/maintenance/preload_sites.py b/scripts/maintenance/preload_sites.py
index c4914d0..6c790e0 100755
--- a/scripts/maintenance/preload_sites.py
+++ b/scripts/maintenance/preload_sites.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Script that preloads site and user info for all sites of given family.

The following parameters are supported:
diff --git a/scripts/maintenance/sorting_order.py b/scripts/maintenance/sorting_order.py
index 68ea584..1d80e2e 100755
--- a/scripts/maintenance/sorting_order.py
+++ b/scripts/maintenance/sorting_order.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Script that updates interwiki sorting order in family.py file."""
#
# (C) Pywikibot team, 2020-2021
diff --git a/scripts/maintenance/update_linktrails.py b/scripts/maintenance/update_linktrails.py
index b0ac04a..abfeddd 100755
--- a/scripts/maintenance/update_linktrails.py
+++ b/scripts/maintenance/update_linktrails.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Script that updates the linktrails in family.py file.

linktrails contains a regex for each site code which holds letters that
diff --git a/scripts/maintenance/update_script.py b/scripts/maintenance/update_script.py
index cc245e5..9c39ada 100755
--- a/scripts/maintenance/update_script.py
+++ b/scripts/maintenance/update_script.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
A helper script to update scripts and replace deprecated parts.

diff --git a/scripts/maintenance/wikimedia_sites.py b/scripts/maintenance/wikimedia_sites.py
index d209dbd..eb4aa6a 100755
--- a/scripts/maintenance/wikimedia_sites.py
+++ b/scripts/maintenance/wikimedia_sites.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Script that updates the language lists in Wikimedia family files.

Usage:
diff --git a/scripts/misspelling.py b/scripts/misspelling.py
index d8cd4d6..34f615f 100755
--- a/scripts/misspelling.py
+++ b/scripts/misspelling.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This script fixes links that contain common spelling mistakes.

diff --git a/scripts/movepages.py b/scripts/movepages.py
index 676ac76..dcacaff 100755
--- a/scripts/movepages.py
+++ b/scripts/movepages.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This script can move pages.

diff --git a/scripts/newitem.py b/scripts/newitem.py
index 76255c4..d828cad 100755
--- a/scripts/newitem.py
+++ b/scripts/newitem.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This script creates new items on Wikidata based on certain criteria.

diff --git a/scripts/noreferences.py b/scripts/noreferences.py
index de7ea9a..036f1d2 100755
--- a/scripts/noreferences.py
+++ b/scripts/noreferences.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This script adds a missing references section to pages.

diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
index 7229c3b..c89fb25 100755
--- a/scripts/nowcommons.py
+++ b/scripts/nowcommons.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
Script to delete files that are also present on Wikimedia Commons.

diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
index f79297b..f8c2145 100755
--- a/scripts/pagefromfile.py
+++ b/scripts/pagefromfile.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
Bot to upload pages from a text file.

diff --git a/scripts/parser_function_count.py b/scripts/parser_function_count.py
index 31f8ecc..08ce8d9 100755
--- a/scripts/parser_function_count.py
+++ b/scripts/parser_function_count.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""
Used to find expensive templates that are subject to be converted to Lua.

@@ -43,7 +44,7 @@
functions will be listed.
"""
#
-# (C) Pywikibot team, 2013-2021
+# (C) Pywikibot team, 2013-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/patrol.py b/scripts/patrol.py
index 0d18317..80959e3 100755
--- a/scripts/patrol.py
+++ b/scripts/patrol.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
The bot is meant to mark the edits based on info obtained by whitelist.

diff --git a/scripts/protect.py b/scripts/protect.py
index ce119f6..a65fb4b 100755
--- a/scripts/protect.py
+++ b/scripts/protect.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This script can be used to protect and unprotect pages en masse.

diff --git a/scripts/redirect.py b/scripts/redirect.py
index 0923db5..ec74455 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to resolve double redirects, and to delete broken redirects.

diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 3623aec..9cf0a51 100755
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Fetch and add titles for bare links in references.

diff --git a/scripts/replace.py b/scripts/replace.py
index d1826b8..4d7f372 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
This bot will make direct text replacements.

diff --git a/scripts/replicate_wiki.py b/scripts/replicate_wiki.py
index 8b01f39..e4dd498 100755
--- a/scripts/replicate_wiki.py
+++ b/scripts/replicate_wiki.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This bot replicates pages in a wiki to a second wiki within one family.

diff --git a/scripts/revertbot.py b/scripts/revertbot.py
index b5e63b4..0616401 100755
--- a/scripts/revertbot.py
+++ b/scripts/revertbot.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
This script can be used for reverting certain edits.

diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 162bec9..88abc43 100755
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to help a human solve disambiguations by presenting a set of options.

diff --git a/scripts/speedy_delete.py b/scripts/speedy_delete.py
index 9ac8fb7..ad68da2 100755
--- a/scripts/speedy_delete.py
+++ b/scripts/speedy_delete.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""
Help sysops to quickly check and/or delete pages listed for speedy deletion.

diff --git a/scripts/template.py b/scripts/template.py
index f2d7b84..cf3252c 100755
--- a/scripts/template.py
+++ b/scripts/template.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
Very simple script to replace a template with another one.

diff --git a/scripts/templatecount.py b/scripts/templatecount.py
index b5101f7..f4c7ace 100755
--- a/scripts/templatecount.py
+++ b/scripts/templatecount.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Display the list of pages transcluding a given list of templates.

diff --git a/scripts/touch.py b/scripts/touch.py
index dd3e68d..292f8ad 100755
--- a/scripts/touch.py
+++ b/scripts/touch.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This bot goes over multiple pages of a wiki, and edits them without changes.

diff --git a/scripts/transferbot.py b/scripts/transferbot.py
index 261618a..ea13014 100755
--- a/scripts/transferbot.py
+++ b/scripts/transferbot.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
r"""
This script transfers pages from a source wiki to a target wiki.

diff --git a/scripts/unusedfiles.py b/scripts/unusedfiles.py
index 947ba18..8836224 100755
--- a/scripts/unusedfiles.py
+++ b/scripts/unusedfiles.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This bot appends some text to all unused images and notifies uploaders.

diff --git a/scripts/upload.py b/scripts/upload.py
index d83d3fa..f40d829 100755
--- a/scripts/upload.py
+++ b/scripts/upload.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to upload images to Wikipedia.

diff --git a/scripts/watchlist.py b/scripts/watchlist.py
index c6f53f4..5bfef5b 100755
--- a/scripts/watchlist.py
+++ b/scripts/watchlist.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Allows access to the bot account's watchlist.

diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index 53753af..9130775 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
This bot is used for checking external links found at the wiki.

diff --git a/scripts/welcome.py b/scripts/welcome.py
index c0e7747..7714301 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Script to welcome new users.

diff --git a/setup.py b/setup.py
index 840534a..6c2323f 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""Installer script for Pywikibot framework.

@@ -27,7 +28,7 @@
- upload this patchset to Gerrit and merge it.
"""
#
-# (C) Pywikibot team, 2009-2021
+# (C) Pywikibot team, 2009-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/add_text_tests.py b/tests/add_text_tests.py
index a79c72f..a323f82 100644
--- a/tests/add_text_tests.py
+++ b/tests/add_text_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test add_text bot module."""
#
-# (C) Pywikibot team, 2016-2021
+# (C) Pywikibot team, 2016-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/api_tests.py b/tests/api_tests.py
index 13a81d5..2464186 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""API test module."""
#
# (C) Pywikibot team, 2007-2022
diff --git a/tests/archive/data_ingestion_tests.py b/tests/archive/data_ingestion_tests.py
index 5e8c0da..7693619 100644
--- a/tests/archive/data_ingestion_tests.py
+++ b/tests/archive/data_ingestion_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Unit tests for data_ingestion.py script."""
#
# (C) Pywikibot team, 2012-2021
diff --git a/tests/archive/disambredir_tests.py b/tests/archive/disambredir_tests.py
index 7e118e0..5512c8e 100644
--- a/tests/archive/disambredir_tests.py
+++ b/tests/archive/disambredir_tests.py
@@ -1,10 +1,11 @@
+#!/usr/bin/python3
"""
DisambigurationRedirectBot test.

These tests write to the wiki.
"""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/archive/imagecopy_tests.py b/tests/archive/imagecopy_tests.py
index c958da4..0183108 100644
--- a/tests/archive/imagecopy_tests.py
+++ b/tests/archive/imagecopy_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for imagecopy script."""
#
-# (C) Pywikibot team, 2018-2020
+# (C) Pywikibot team, 2018-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/archive/isbn_tests.py b/tests/archive/isbn_tests.py
index b159370..866fa14 100644
--- a/tests/archive/isbn_tests.py
+++ b/tests/archive/isbn_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for isbn script."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/archivebot_tests.py b/tests/archivebot_tests.py
index 03df558..fc84942 100644
--- a/tests/archivebot_tests.py
+++ b/tests/archivebot_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for archivebot scripts."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/basepage.py b/tests/basepage.py
index 7b1b01a..8a3fa70 100644
--- a/tests/basepage.py
+++ b/tests/basepage.py
@@ -1,12 +1,9 @@
-"""Tests for BasePage subclasses."""
+"""BasePage tests subclasses."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
-import unittest
-from contextlib import suppress
-
from pywikibot.page import BasePage
from tests.aspects import TestCase

@@ -137,8 +134,3 @@
self.assertEqual(self._page.templates(), [])
self.assertFalse(self._page.isCategoryRedirect())
self.assertTrue(self._page.botMayEdit())
-
-
-if __name__ == '__main__': # pragma: no cover
- with suppress(SystemExit):
- unittest.main()
diff --git a/tests/basesite_tests.py b/tests/basesite_tests.py
index 93acd02..7d3f3e3 100644
--- a/tests/basesite_tests.py
+++ b/tests/basesite_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the site module."""
#
-# (C) Pywikibot team, 2008-2021
+# (C) Pywikibot team, 2008-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/bot_tests.py b/tests/bot_tests.py
index 06ad46f..d950ab5 100644
--- a/tests/bot_tests.py
+++ b/tests/bot_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Bot tests."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/cache_tests.py b/tests/cache_tests.py
index 4767907..e5d489e 100644
--- a/tests/cache_tests.py
+++ b/tests/cache_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""API Request cache tests."""
#
-# (C) Pywikibot team, 2012-2021
+# (C) Pywikibot team, 2012-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/category_bot_tests.py b/tests/category_bot_tests.py
index 98926a7..aa58282 100644
--- a/tests/category_bot_tests.py
+++ b/tests/category_bot_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the category bot script."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/category_tests.py b/tests/category_tests.py
index a39a684..fedad53 100644
--- a/tests/category_tests.py
+++ b/tests/category_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the Category class."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/checkimages_tests.py b/tests/checkimages_tests.py
index da52de4..b0da988 100644
--- a/tests/checkimages_tests.py
+++ b/tests/checkimages_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Unit tests for checkimages script."""
#
# (C) Pywikibot team, 2015-2021
diff --git a/tests/collections_tests.py b/tests/collections_tests.py
index 2bfec55..f2b80ec 100644
--- a/tests/collections_tests.py
+++ b/tests/collections_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""Tests for the Wikidata parts of the page module."""
#
# (C) Pywikibot team, 2019-2021
diff --git a/tests/cosmetic_changes_tests.py b/tests/cosmetic_changes_tests.py
index b0f8fed..7907f83 100644
--- a/tests/cosmetic_changes_tests.py
+++ b/tests/cosmetic_changes_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""Test cosmetic_changes module."""
#
# (C) Pywikibot team, 2015-2022
diff --git a/tests/datasite_tests.py b/tests/datasite_tests.py
index 595e5e8..25c2a0d 100644
--- a/tests/datasite_tests.py
+++ b/tests/datasite_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the site module."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/date_tests.py b/tests/date_tests.py
index d76989f..00fe072 100644
--- a/tests/date_tests.py
+++ b/tests/date_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the date module."""
#
-# (C) Pywikibot team, 2012-2021
+# (C) Pywikibot team, 2012-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/deletionbot_tests.py b/tests/deletionbot_tests.py
index 2e08ace..d871c89 100644
--- a/tests/deletionbot_tests.py
+++ b/tests/deletionbot_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for scripts/delete.py."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/deprecation_tests.py b/tests/deprecation_tests.py
index a802401..649fb42 100644
--- a/tests/deprecation_tests.py
+++ b/tests/deprecation_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for deprecation tools."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/diff_tests.py b/tests/diff_tests.py
index 6fdea61..5e7ecfb 100644
--- a/tests/diff_tests.py
+++ b/tests/diff_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Test diff module."""
#
# (C) Pywikibot team, 2016-2021
diff --git a/tests/djvu_tests.py b/tests/djvu_tests.py
index 7fc867a..867d34c 100644
--- a/tests/djvu_tests.py
+++ b/tests/djvu_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Unit tests for djvu.py."""

#
diff --git a/tests/dry_api_tests.py b/tests/dry_api_tests.py
index 9b998ac..9fc9175 100644
--- a/tests/dry_api_tests.py
+++ b/tests/dry_api_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""API tests which do not interact with a site."""
#
-# (C) Pywikibot team, 2012-2021
+# (C) Pywikibot team, 2012-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/dry_site_tests.py b/tests/dry_site_tests.py
index 76a8c62..9f27752 100644
--- a/tests/dry_site_tests.py
+++ b/tests/dry_site_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests against a fake Site object."""
#
-# (C) Pywikibot team, 2012-2021
+# (C) Pywikibot team, 2012-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/echo_tests.py b/tests/echo_tests.py
index af5e924..9f48901 100644
--- a/tests/echo_tests.py
+++ b/tests/echo_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test echo module."""
#
-# (C) Pywikibot team, 2019-2021
+# (C) Pywikibot team, 2019-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/edit_failure_tests.py b/tests/edit_failure_tests.py
index fa7997d..cb927c9 100644
--- a/tests/edit_failure_tests.py
+++ b/tests/edit_failure_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""
Tests for edit failures.

@@ -7,7 +8,7 @@
These tests use special code 'write = -1' for edit failures.
"""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/edit_tests.py b/tests/edit_tests.py
index 152747d..32c1a4e 100644
--- a/tests/edit_tests.py
+++ b/tests/edit_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for editing pages."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/eventstreams_tests.py b/tests/eventstreams_tests.py
index 4be75b5..61262b6 100644
--- a/tests/eventstreams_tests.py
+++ b/tests/eventstreams_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the eventstreams module."""
#
-# (C) Pywikibot team, 2017-2021
+# (C) Pywikibot team, 2017-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/family_tests.py b/tests/family_tests.py
index bcaea49..d048431 100644
--- a/tests/family_tests.py
+++ b/tests/family_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""Tests for the family module."""
#
# (C) Pywikibot team, 2014-2022
diff --git a/tests/file_tests.py b/tests/file_tests.py
index bee9347..d01d93b 100644
--- a/tests/file_tests.py
+++ b/tests/file_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""FilePage tests."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/fixes_tests.py b/tests/fixes_tests.py
index a4a49e9..8bff0ca 100644
--- a/tests/fixes_tests.py
+++ b/tests/fixes_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for fixes module."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/fixing_redirects_tests.py b/tests/fixing_redirects_tests.py
index 2fd1b72..8c7272f 100644
--- a/tests/fixing_redirects_tests.py
+++ b/tests/fixing_redirects_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test fixing redirects bot module."""
#
-# (C) Pywikibot team, 2018-2020
+# (C) Pywikibot team, 2018-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/flow_edit_tests.py b/tests/flow_edit_tests.py
index 1560f74..74333f0 100644
--- a/tests/flow_edit_tests.py
+++ b/tests/flow_edit_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Edit tests for the flow module."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/flow_tests.py b/tests/flow_tests.py
index 01eb922..8083358 100644
--- a/tests/flow_tests.py
+++ b/tests/flow_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the flow module."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/flow_thanks_tests.py b/tests/flow_thanks_tests.py
index 57c6f93..d26d123 100644
--- a/tests/flow_thanks_tests.py
+++ b/tests/flow_thanks_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for thanks-related code."""
#
-# (C) Pywikibot team, 2016-2021
+# (C) Pywikibot team, 2016-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/generate_family_file_tests.py b/tests/generate_family_file_tests.py
index 9026f69..079fe7f 100644
--- a/tests/generate_family_file_tests.py
+++ b/tests/generate_family_file_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test generate_family_file script."""
#
-# (C) Pywikibot team, 2018-2021
+# (C) Pywikibot team, 2018-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/generate_user_files_tests.py b/tests/generate_user_files_tests.py
index 2824de5..982eeab 100644
--- a/tests/generate_user_files_tests.py
+++ b/tests/generate_user_files_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test generate_user_files script."""
#
-# (C) Pywikibot team, 2018-2021
+# (C) Pywikibot team, 2018-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/http_tests.py b/tests/http_tests.py
index 36f07f9..e1096cf 100644
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""Tests for http module."""
#
# (C) Pywikibot team, 2014-2022
diff --git a/tests/i18n_tests.py b/tests/i18n_tests.py
index 946c0c3..616147f 100644
--- a/tests/i18n_tests.py
+++ b/tests/i18n_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test i18n module."""
#
-# (C) Pywikibot team, 2007-2021
+# (C) Pywikibot team, 2007-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/interwiki_graph_tests.py b/tests/interwiki_graph_tests.py
index 19321a4..a89e110 100644
--- a/tests/interwiki_graph_tests.py
+++ b/tests/interwiki_graph_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Test Interwiki Graph functionality."""
#
# (C) Pywikibot team, 2015-2022
diff --git a/tests/interwiki_link_tests.py b/tests/interwiki_link_tests.py
index bc30396..aa07bfa 100644
--- a/tests/interwiki_link_tests.py
+++ b/tests/interwiki_link_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test Interwiki Link functionality."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/interwikidata_tests.py b/tests/interwikidata_tests.py
index a2bbeba..21d317b 100644
--- a/tests/interwikidata_tests.py
+++ b/tests/interwikidata_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for scripts/interwikidata.py."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/interwikimap_tests.py b/tests/interwikimap_tests.py
index a96597c..971f9fd 100644
--- a/tests/interwikimap_tests.py
+++ b/tests/interwikimap_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the site module."""
#
-# (C) Pywikibot team, 2018-2021
+# (C) Pywikibot team, 2018-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/l10n_tests.py b/tests/l10n_tests.py
index b4fc367..e52e5ba 100644
--- a/tests/l10n_tests.py
+++ b/tests/l10n_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""Test valid templates."""
#
# (C) Pywikibot team, 2015-2022
diff --git a/tests/link_tests.py b/tests/link_tests.py
index f8e9dbb..f1c132f 100644
--- a/tests/link_tests.py
+++ b/tests/link_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test Link functionality."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/linter_tests.py b/tests/linter_tests.py
index a304d88..9a402a5 100644
--- a/tests/linter_tests.py
+++ b/tests/linter_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the site module."""
#
-# (C) Pywikibot team, 2018-2021
+# (C) Pywikibot team, 2018-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/logentries_tests.py b/tests/logentries_tests.py
index 990acf2..bcacfdb 100644
--- a/tests/logentries_tests.py
+++ b/tests/logentries_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test logentries module."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/login_tests.py b/tests/login_tests.py
index c1f60dd..be4e8c5 100644
--- a/tests/login_tests.py
+++ b/tests/login_tests.py
@@ -1,10 +1,11 @@
+#!/usr/bin/python3
"""
Tests for LoginManager classes.

e.g. used to test password-file based login.
"""
#
-# (C) Pywikibot team, 2012-2021
+# (C) Pywikibot team, 2012-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/mediawikiversion_tests.py b/tests/mediawikiversion_tests.py
index 3e13cc7..b183148 100644
--- a/tests/mediawikiversion_tests.py
+++ b/tests/mediawikiversion_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the tools.MediaWikiVersion class."""
#
-# (C) Pywikibot team, 2008-2021
+# (C) Pywikibot team, 2008-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/mysql_tests.py b/tests/mysql_tests.py
index aeb986f..fac64cb 100644
--- a/tests/mysql_tests.py
+++ b/tests/mysql_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for mysql module."""
#
-# (C) Pywikibot team, 2021
+# (C) Pywikibot team, 2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/namespace_tests.py b/tests/namespace_tests.py
index e1cb2d7..401e502 100644
--- a/tests/namespace_tests.py
+++ b/tests/namespace_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the Namespace class."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/noreferences_tests.py b/tests/noreferences_tests.py
index eec24fe..8cb112b 100644
--- a/tests/noreferences_tests.py
+++ b/tests/noreferences_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test noreferences bot module."""
#
-# (C) Pywikibot team, 2018-2021
+# (C) Pywikibot team, 2018-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/oauth_tests.py b/tests/oauth_tests.py
index 7dc8556..2885c98 100644
--- a/tests/oauth_tests.py
+++ b/tests/oauth_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test OAuth functionality."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/page_tests.py b/tests/page_tests.py
index 2bf2674..9a37684 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the page module."""
#
-# (C) Pywikibot team, 2008-2021
+# (C) Pywikibot team, 2008-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 6129d5e..e235662 100644
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Test pagegenerators module."""
#
# (C) Pywikibot team, 2009-2021
diff --git a/tests/paraminfo_tests.py b/tests/paraminfo_tests.py
index 92f257b..0f26e3d 100644
--- a/tests/paraminfo_tests.py
+++ b/tests/paraminfo_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test confirming paraminfo contains expected values."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/patrolbot_tests.py b/tests/patrolbot_tests.py
index 9521da8..b69d404 100644
--- a/tests/patrolbot_tests.py
+++ b/tests/patrolbot_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the patrol script."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/plural_tests.py b/tests/plural_tests.py
index 46a77b1..6ee7891 100644
--- a/tests/plural_tests.py
+++ b/tests/plural_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test plural module."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/proofreadpage_tests.py b/tests/proofreadpage_tests.py
index 4c20284..33f29f3 100644
--- a/tests/proofreadpage_tests.py
+++ b/tests/proofreadpage_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the proofreadpage module."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/protectbot_tests.py b/tests/protectbot_tests.py
index b1cde94..6b3dda9 100644
--- a/tests/protectbot_tests.py
+++ b/tests/protectbot_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for scripts/protect.py."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/pwb/print_argv.py b/tests/pwb/print_argv.py
index 76d1adb..85c47c9 100644
--- a/tests/pwb/print_argv.py
+++ b/tests/pwb/print_argv.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Script that forms part of pwb_tests.

.. versionadded:: 7.0
diff --git a/tests/pwb/print_env.py b/tests/pwb/print_env.py
index 29e364c..e1cac4a 100644
--- a/tests/pwb/print_env.py
+++ b/tests/pwb/print_env.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Script that forms part of pwb_tests."""
#
# (C) Pywikibot team, 2015-2021
diff --git a/tests/pwb/print_locals.py b/tests/pwb/print_locals.py
index 4560441..04024d4 100644
--- a/tests/pwb/print_locals.py
+++ b/tests/pwb/print_locals.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Script that forms part of pwb_tests."""
#
# (C) Pywikibot team, 2013-2021
diff --git a/tests/pwb/print_unicode.py b/tests/pwb/print_unicode.py
index 3f93dc7..97b70a1 100644
--- a/tests/pwb/print_unicode.py
+++ b/tests/pwb/print_unicode.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Script that forms part of pwb_tests."""
#
# (C) Pywikibot team, 2018-2021
diff --git a/tests/pwb_tests.py b/tests/pwb_tests.py
index 2d59c6b..b1afeff 100644
--- a/tests/pwb_tests.py
+++ b/tests/pwb_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""
Test pwb.py.

@@ -6,7 +7,7 @@
https://bitbucket.org/ned/coveragepy/src/default/tests/test_execfile.py
"""
#
-# (C) Pywikibot team, 2007-2021
+# (C) Pywikibot team, 2007-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/redirect_bot_tests.py b/tests/redirect_bot_tests.py
index d8fb021..f7aa2a9 100644
--- a/tests/redirect_bot_tests.py
+++ b/tests/redirect_bot_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the redirect.py script."""
#
-# (C) Pywikibot team, 2017-2021
+# (C) Pywikibot team, 2017-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/reflinks_tests.py b/tests/reflinks_tests.py
index 7b2642e..0098d16 100644
--- a/tests/reflinks_tests.py
+++ b/tests/reflinks_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for reflinks script."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/replacebot_tests.py b/tests/replacebot_tests.py
index 863ab1f..9ee153b 100644
--- a/tests/replacebot_tests.py
+++ b/tests/replacebot_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the replace script and ReplaceRobot class."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/script_tests.py b/tests/script_tests.py
index 18a9e8e..fa02e3e 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test that each script can be compiled and executed."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/site_decorators_tests.py b/tests/site_decorators_tests.py
index 4ff9dbf..bc4df9c 100644
--- a/tests/site_decorators_tests.py
+++ b/tests/site_decorators_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests against a fake Site object."""
#
-# (C) Pywikibot team, 2012-2021
+# (C) Pywikibot team, 2012-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/site_detect_tests.py b/tests/site_detect_tests.py
index fd9d397..b675b51 100644
--- a/tests/site_detect_tests.py
+++ b/tests/site_detect_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test for site detection."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/site_tests.py b/tests/site_tests.py
index ce5b703..d8c1e06 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""Tests for the site module."""
#
# (C) Pywikibot team, 2008-2022
diff --git a/tests/siteinfo_tests.py b/tests/siteinfo_tests.py
index 51136ee..9b0e099 100644
--- a/tests/siteinfo_tests.py
+++ b/tests/siteinfo_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the site module."""
#
-# (C) Pywikibot team, 2008-2021
+# (C) Pywikibot team, 2008-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/sparql_tests.py b/tests/sparql_tests.py
index 784d3e6..15724d8 100644
--- a/tests/sparql_tests.py
+++ b/tests/sparql_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test cases for the SPARQL API."""
#
-# (C) Pywikibot team, 2016-2021
+# (C) Pywikibot team, 2016-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/template_bot_tests.py b/tests/template_bot_tests.py
index 48b4e1b..96aa4a3 100644
--- a/tests/template_bot_tests.py
+++ b/tests/template_bot_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test template bot module."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/tests_tests.py b/tests/tests_tests.py
index 4f46030..b868d47 100644
--- a/tests/tests_tests.py
+++ b/tests/tests_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Tests for the tests package."""
#
# (C) Pywikibot team, 2014-2021
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index d72da99..f52dc4d 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""Test textlib module."""
#
# (C) Pywikibot team, 2011-2022
diff --git a/tests/thanks_tests.py b/tests/thanks_tests.py
index dda33b7..c7a1422 100644
--- a/tests/thanks_tests.py
+++ b/tests/thanks_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for thanks-related code."""
#
-# (C) Pywikibot team, 2016-2021
+# (C) Pywikibot team, 2016-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/thread_tests.py b/tests/thread_tests.py
index 329017f..61c313b 100644
--- a/tests/thread_tests.py
+++ b/tests/thread_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for threading tools."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/timestamp_tests.py b/tests/timestamp_tests.py
index 18b8bd7..04692a8 100644
--- a/tests/timestamp_tests.py
+++ b/tests/timestamp_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the Timestamp class."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/timestripper_tests.py b/tests/timestripper_tests.py
index 05fc8d7..45c4eca 100644
--- a/tests/timestripper_tests.py
+++ b/tests/timestripper_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for archivebot.py/Timestripper."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/titletranslate_tests.py b/tests/titletranslate_tests.py
index 2a722bb..6189ce5 100644
--- a/tests/titletranslate_tests.py
+++ b/tests/titletranslate_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for titletranslate module."""
#
-# (C) Pywikibot team, 2021
+# (C) Pywikibot team, 2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/tk_tests.py b/tests/tk_tests.py
index 6696c9f..c35a998 100644
--- a/tests/tk_tests.py
+++ b/tests/tk_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the Tk UI."""
#
-# (C) Pywikibot team, 2008-2021
+# (C) Pywikibot team, 2008-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/token_tests.py b/tests/token_tests.py
index 3189343..e31d9ec 100644
--- a/tests/token_tests.py
+++ b/tests/token_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for tokens."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/tools_chars_tests.py b/tests/tools_chars_tests.py
index abe9f51..f42e4b5 100644
--- a/tests/tools_chars_tests.py
+++ b/tests/tools_chars_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Test tools.chars package."""
#
# (C) Pywikibot team, 2015-2021
diff --git a/tests/tools_formatter_tests.py b/tests/tools_formatter_tests.py
index 84e6b9b..20f0cdb 100644
--- a/tests/tools_formatter_tests.py
+++ b/tests/tools_formatter_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the ``pywikibot.tools.formatter`` module."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/tools_tests.py b/tests/tools_tests.py
index e091aeb..4b073a5 100644
--- a/tests/tools_tests.py
+++ b/tests/tools_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""Test tools package alone which don't fit into other tests."""
#
# (C) Pywikibot team, 2015-2022
diff --git a/tests/ui_options_tests.py b/tests/ui_options_tests.py
index a9804ee..fed1970 100644
--- a/tests/ui_options_tests.py
+++ b/tests/ui_options_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Bot tests for input_choice options."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/ui_tests.py b/tests/ui_tests.py
index e9af702..20fcf87 100644
--- a/tests/ui_tests.py
+++ b/tests/ui_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the user interface."""
#
-# (C) Pywikibot team, 2008-2021
+# (C) Pywikibot team, 2008-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/update_script_tests.py b/tests/update_script_tests.py
index 9047031..539828c 100644
--- a/tests/update_script_tests.py
+++ b/tests/update_script_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""update_script.py tests."""
#
-# (C) Pywikibot team, 2019-2021
+# (C) Pywikibot team, 2019-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/upload_tests.py b/tests/upload_tests.py
index 9616b4b..77740ce 100644
--- a/tests/upload_tests.py
+++ b/tests/upload_tests.py
@@ -1,10 +1,11 @@
+#!/usr/bin/python3
"""
Site upload test.

These tests write to the wiki.
"""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/uploadbot_tests.py b/tests/uploadbot_tests.py
index e18d6ff..c0ca484 100644
--- a/tests/uploadbot_tests.py
+++ b/tests/uploadbot_tests.py
@@ -1,10 +1,11 @@
+#!/usr/bin/python3
"""
UploadRobot test.

These tests write to the wiki.
"""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/uploadscript_tests.py b/tests/uploadscript_tests.py
index ce2b8f9..89c7309 100644
--- a/tests/uploadscript_tests.py
+++ b/tests/uploadscript_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""upload.py script test."""
#
-# (C) Pywikibot team, 2019-2021
+# (C) Pywikibot team, 2019-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/user_tests.py b/tests/user_tests.py
index 7485349..67b1479 100644
--- a/tests/user_tests.py
+++ b/tests/user_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the User page."""
#
-# (C) Pywikibot team, 2016-2021
+# (C) Pywikibot team, 2016-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/weblinkchecker_tests.py b/tests/weblinkchecker_tests.py
index 9ae1e67..9dd1109 100644
--- a/tests/weblinkchecker_tests.py
+++ b/tests/weblinkchecker_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""weblinkchecker test module."""
#
-# (C) Pywikibot team, 2015-2021
+# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/wikibase_edit_tests.py b/tests/wikibase_edit_tests.py
index c59b0a6..40cd4d3 100644
--- a/tests/wikibase_edit_tests.py
+++ b/tests/wikibase_edit_tests.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
"""
Tests for editing Wikibase items.

@@ -5,7 +6,7 @@
class in edit_failiure_tests.py
"""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 1231120..b60a18b 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for the Wikidata parts of the page module."""
#
-# (C) Pywikibot team, 2008-2021
+# (C) Pywikibot team, 2008-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/wikistats_tests.py b/tests/wikistats_tests.py
index 79e4fe2..778a80e 100644
--- a/tests/wikistats_tests.py
+++ b/tests/wikistats_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Test cases for the WikiStats dataset."""
#
-# (C) Pywikibot team, 2014-2021
+# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/xmlreader_tests.py b/tests/xmlreader_tests.py
index ad968b3..bcb4a32 100644
--- a/tests/xmlreader_tests.py
+++ b/tests/xmlreader_tests.py
@@ -1,6 +1,7 @@
+#!/usr/bin/python3
"""Tests for xmlreader module."""
#
-# (C) Pywikibot team, 2009-2021
+# (C) Pywikibot team, 2009-2022
#
# Distributed under the terms of the MIT license.
#

To view, visit change 752337. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ie3281d84e1dc112a12cf418a217743f64de4e190
Gerrit-Change-Number: 752337
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: Hashar <hashar@free.fr>
Gerrit-MessageType: merged