From a099e698e2754b2f0ffac1d73e6f1c79f03edbf9 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Wed, 2 Aug 2017 14:15:16 -0700 Subject: [PATCH] py3: Switch almost all shebang lines to use `python3`. This causes `upgrade-zulip-from-git`, as well as a no-option run of `tools/build-release-tarball`, to produce a Zulip install running Python 3, rather than Python 2. In particular this means that the virtualenv we create, in which all application code runs, is Python 3. One shebang line, on `zulip-ec2-configure-interfaces`, explicitly keeps Python 2, and at least one external ops script, `wal-e`, also still runs on Python 2. See discussion on the respective previous commits that made those explicit. There may also be some other third-party scripts we use, outside of this source tree and running outside our virtualenv, that still run on Python 2. --- docs/html_unescape.py | 2 +- frontend_tests/run-casper | 2 +- manage.py | 2 +- .../files/nagios_plugins/zulip_app_frontend/check_cron_file | 2 +- .../nagios_plugins/zulip_app_frontend/check_queue_worker_errors | 2 +- .../nagios_plugins/zulip_app_frontend/check_rabbitmq_consumers | 2 +- .../nagios_plugins/zulip_app_frontend/check_rabbitmq_queues | 2 +- .../nagios_plugins/zulip_app_frontend/check_send_receive_time | 2 +- .../zulip_nagios_server/check_postgres_replication_lag | 2 +- .../nagios_plugins/zulip_postgres_appdb/check_fts_update_log | 2 +- .../nagios_plugins/zulip_postgres_common/check_postgres_backup | 2 +- puppet/zulip/files/postgresql/pg_backup_and_purge.py | 2 +- puppet/zulip/files/postgresql/process_fts_updates | 2 +- .../zulip_zephyr_mirror/check_personal_zephyr_mirrors | 2 +- .../zulip_zephyr_mirror/check_user_zephyr_mirror_liveness | 2 +- .../nagios_plugins/zulip_zephyr_mirror/check_zephyr_mirror | 2 +- scripts/get-django-setting | 2 +- scripts/lib/create-production-venv | 2 +- scripts/lib/email-mirror-postfix | 2 +- scripts/lib/hash_reqs.py | 2 +- scripts/lib/log-management-command | 2 +- scripts/lib/queue_workers.py | 2 +- scripts/lib/unpack-zulip | 2 +- scripts/lib/upgrade-zulip | 2 +- scripts/lib/upgrade-zulip-stage-2 | 2 +- scripts/lib/zulip_tools.py | 2 +- scripts/nagios/check-rabbitmq-consumers | 2 +- scripts/nagios/check-rabbitmq-queue | 2 +- scripts/purge-old-deployments | 2 +- scripts/restart-server | 2 +- scripts/setup/generate_secrets.py | 2 +- scripts/upgrade-zulip-from-git | 2 +- scripts/zulip-puppet-apply | 2 +- static/assets/favicon/generate | 2 +- tools/check-capitalization | 2 +- tools/check-css | 2 +- tools/check-frontend-i18n | 2 +- tools/check-issue-labels | 2 +- tools/check-provision | 2 +- tools/check-templates | 2 +- tools/check-urls | 2 +- tools/clean-emoji-cache | 2 +- tools/clean-npm-cache | 2 +- tools/clean-venv-cache | 2 +- tools/compile-handlebars-templates | 2 +- tools/create-test-api-docs | 2 +- tools/diagnose | 2 +- .../documentation_crawler/spiders/check_documentation.py | 2 +- .../documentation_crawler/spiders/check_help_documentation.py | 2 +- .../documentation_crawler/spiders/common/spiders.py | 2 +- tools/find-add-class | 2 +- tools/get-handlebar-vars | 2 +- tools/html-grep | 2 +- tools/js-dep-visualizer.py | 2 +- tools/lib/provision.py | 2 +- tools/lib/sanity_check.py | 2 +- tools/lint | 2 +- tools/lister.py | 2 +- tools/minify-js | 2 +- tools/pretty-print-html | 2 +- tools/renumber-migrations | 2 +- tools/replace-tarball-shebang | 2 +- tools/review | 2 +- tools/run-dev-queue-processors | 2 +- tools/run-dev.py | 2 +- tools/run-mypy | 2 +- tools/send_github_payloads.py | 2 +- tools/setup/build_pygments_data.py | 2 +- tools/setup/emoji/build_emoji | 2 +- tools/setup/setup_venvs.py | 2 +- tools/show-profile-results.py | 2 +- tools/stop_run_dev | 2 +- tools/test-api | 2 +- tools/test-backend | 2 +- tools/test-help-documentation.py | 2 +- tools/test-js-with-node | 2 +- tools/test-queue-worker-reload | 2 +- tools/test-run-dev | 2 +- tools/test-tools | 2 +- tools/test_user_agent_parsing.py | 2 +- tools/update-authors-json | 2 +- tools/update-prod-static | 2 +- tools/webpack | 2 +- tools/zulip-export/zulip-export | 2 +- zerver/management/commands/deliver_email.py | 2 +- zerver/management/commands/email_mirror.py | 2 +- zerver/management/commands/print_email_delivery_backlog.py | 2 +- zerver/views/test_emails.py | 2 +- 88 files changed, 88 insertions(+), 88 deletions(-) diff --git a/docs/html_unescape.py b/docs/html_unescape.py index 18d83d331d..0538228bb3 100755 --- a/docs/html_unescape.py +++ b/docs/html_unescape.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function # Remove HTML entity escaping left over from MediaWiki->rST conversion. diff --git a/frontend_tests/run-casper b/frontend_tests/run-casper index 0806704540..f23933b060 100755 --- a/frontend_tests/run-casper +++ b/frontend_tests/run-casper @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import optparse import subprocess diff --git a/manage.py b/manage.py index 57f45b57a4..823c1558e5 100755 --- a/manage.py +++ b/manage.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_cron_file b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_cron_file index 273d31adb8..8533388b3a 100755 --- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_cron_file +++ b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_cron_file @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Nagios plugin paired with a cron job. This just verifies that the file output by the cron job is correct. """ diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_queue_worker_errors b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_queue_worker_errors index 53d5f7fd1d..4c65eeb278 100755 --- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_queue_worker_errors +++ b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_queue_worker_errors @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Nagios plugin to check that none of our queue workers have reported errors. diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_rabbitmq_consumers b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_rabbitmq_consumers index 0779273e25..9dc28ab29b 100755 --- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_rabbitmq_consumers +++ b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_rabbitmq_consumers @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Nagios plugin to check that the rabbitmq has the correct number of consumers. diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_rabbitmq_queues b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_rabbitmq_queues index 1af70c390c..ed5a999b90 100755 --- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_rabbitmq_queues +++ b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_rabbitmq_queues @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Nagios plugin to check that the rabbitmq queues are not overflowing as a result diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time index c376b08926..5f35bd457d 100755 --- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time +++ b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Script to provide information about send-receive times. diff --git a/puppet/zulip/files/nagios_plugins/zulip_nagios_server/check_postgres_replication_lag b/puppet/zulip/files/nagios_plugins/zulip_nagios_server/check_postgres_replication_lag index 5cc5d863c3..040036c763 100755 --- a/puppet/zulip/files/nagios_plugins/zulip_nagios_server/check_postgres_replication_lag +++ b/puppet/zulip/files/nagios_plugins/zulip_nagios_server/check_postgres_replication_lag @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Nagios plugin to check the difference between the primary and diff --git a/puppet/zulip/files/nagios_plugins/zulip_postgres_appdb/check_fts_update_log b/puppet/zulip/files/nagios_plugins/zulip_postgres_appdb/check_fts_update_log index 2e4117c1d0..adddb58d4c 100755 --- a/puppet/zulip/files/nagios_plugins/zulip_postgres_appdb/check_fts_update_log +++ b/puppet/zulip/files/nagios_plugins/zulip_postgres_appdb/check_fts_update_log @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Nagios plugin to check the length of the FTS update log. diff --git a/puppet/zulip/files/nagios_plugins/zulip_postgres_common/check_postgres_backup b/puppet/zulip/files/nagios_plugins/zulip_postgres_common/check_postgres_backup index 50f01911f2..516063313f 100755 --- a/puppet/zulip/files/nagios_plugins/zulip_postgres_common/check_postgres_backup +++ b/puppet/zulip/files/nagios_plugins/zulip_postgres_common/check_postgres_backup @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import subprocess diff --git a/puppet/zulip/files/postgresql/pg_backup_and_purge.py b/puppet/zulip/files/postgresql/pg_backup_and_purge.py index a0d4ee9f0c..fbf57c670d 100755 --- a/puppet/zulip/files/postgresql/pg_backup_and_purge.py +++ b/puppet/zulip/files/postgresql/pg_backup_and_purge.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function diff --git a/puppet/zulip/files/postgresql/process_fts_updates b/puppet/zulip/files/postgresql/process_fts_updates index 1f916c1f14..c05156d735 100755 --- a/puppet/zulip/files/postgresql/process_fts_updates +++ b/puppet/zulip/files/postgresql/process_fts_updates @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Processes updates to postgres Full Text Search for new/edited messages. # # Zulip manages its postgres full-text search as follows. When the diff --git a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_personal_zephyr_mirrors b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_personal_zephyr_mirrors index 2e3edd00f1..c392b37451 100755 --- a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_personal_zephyr_mirrors +++ b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_personal_zephyr_mirrors @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Nagios plugin to check that Zephyr personals mirrors are forwarding. diff --git a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness index b5ce853bd5..c927603cf6 100755 --- a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness +++ b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Nagios plugin to check that our MIT users' Zephyr mirrors are running. diff --git a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_zephyr_mirror b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_zephyr_mirror index 725888ff75..757f0ff841 100755 --- a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_zephyr_mirror +++ b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_zephyr_mirror @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Nagios plugin to check that Zephyr mirror forwarding is running. diff --git a/scripts/get-django-setting b/scripts/get-django-setting index 1f623b06ef..018a2fe8a1 100755 --- a/scripts/get-django-setting +++ b/scripts/get-django-setting @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/scripts/lib/create-production-venv b/scripts/lib/create-production-venv index 11ab48c8d1..fa184d4c17 100755 --- a/scripts/lib/create-production-venv +++ b/scripts/lib/create-production-venv @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import argparse diff --git a/scripts/lib/email-mirror-postfix b/scripts/lib/email-mirror-postfix index 1095654063..9fcc7048e5 100755 --- a/scripts/lib/email-mirror-postfix +++ b/scripts/lib/email-mirror-postfix @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Forward messages sent to the configured email gateway to Zulip. diff --git a/scripts/lib/hash_reqs.py b/scripts/lib/hash_reqs.py index 0a87fd83a3..d6555438b0 100755 --- a/scripts/lib/hash_reqs.py +++ b/scripts/lib/hash_reqs.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function diff --git a/scripts/lib/log-management-command b/scripts/lib/log-management-command index 908a9638e3..5e2be57852 100755 --- a/scripts/lib/log-management-command +++ b/scripts/lib/log-management-command @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import logging import os diff --git a/scripts/lib/queue_workers.py b/scripts/lib/queue_workers.py index fccd0392c5..074f1f5067 100755 --- a/scripts/lib/queue_workers.py +++ b/scripts/lib/queue_workers.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import argparse diff --git a/scripts/lib/unpack-zulip b/scripts/lib/unpack-zulip index 613dd1f573..cd5def7fc1 100755 --- a/scripts/lib/unpack-zulip +++ b/scripts/lib/unpack-zulip @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os import sys diff --git a/scripts/lib/upgrade-zulip b/scripts/lib/upgrade-zulip index 98afc63460..8183dae0d3 100755 --- a/scripts/lib/upgrade-zulip +++ b/scripts/lib/upgrade-zulip @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os import shutil diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2 index 10f7c39980..c159ba6199 100755 --- a/scripts/lib/upgrade-zulip-stage-2 +++ b/scripts/lib/upgrade-zulip-stage-2 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # This script contains the actual logic for upgrading from an old # version of Zulip to the new version. upgrade-zulip-stage-2 is diff --git a/scripts/lib/zulip_tools.py b/scripts/lib/zulip_tools.py index 3631cda9be..49a678f12e 100755 --- a/scripts/lib/zulip_tools.py +++ b/scripts/lib/zulip_tools.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import datetime import errno diff --git a/scripts/nagios/check-rabbitmq-consumers b/scripts/nagios/check-rabbitmq-consumers index de1fc9c358..8b79694d38 100755 --- a/scripts/nagios/check-rabbitmq-consumers +++ b/scripts/nagios/check-rabbitmq-consumers @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import sys diff --git a/scripts/nagios/check-rabbitmq-queue b/scripts/nagios/check-rabbitmq-queue index 166d563b92..5fd1a744b5 100755 --- a/scripts/nagios/check-rabbitmq-queue +++ b/scripts/nagios/check-rabbitmq-queue @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import sys diff --git a/scripts/purge-old-deployments b/scripts/purge-old-deployments index 53e1664d2b..6933d1b5cb 100755 --- a/scripts/purge-old-deployments +++ b/scripts/purge-old-deployments @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import os import logging diff --git a/scripts/restart-server b/scripts/restart-server index 09cf2286bf..c7a98632c3 100755 --- a/scripts/restart-server +++ b/scripts/restart-server @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os import sys diff --git a/scripts/setup/generate_secrets.py b/scripts/setup/generate_secrets.py index 29411bdd0a..cc1d0ba7b6 100755 --- a/scripts/setup/generate_secrets.py +++ b/scripts/setup/generate_secrets.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # This tools generates /etc/zulip/zulip-secrets.conf from __future__ import print_function diff --git a/scripts/upgrade-zulip-from-git b/scripts/upgrade-zulip-from-git index 7ab4e89c60..4b3c60fa42 100755 --- a/scripts/upgrade-zulip-from-git +++ b/scripts/upgrade-zulip-from-git @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os from six.moves import configparser diff --git a/scripts/zulip-puppet-apply b/scripts/zulip-puppet-apply index 267bdcc14c..b7258f8df7 100755 --- a/scripts/zulip-puppet-apply +++ b/scripts/zulip-puppet-apply @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os diff --git a/static/assets/favicon/generate b/static/assets/favicon/generate index 5e966561f2..54bdb2b0c8 100755 --- a/static/assets/favicon/generate +++ b/static/assets/favicon/generate @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import import xml.etree.ElementTree as ET import subprocess diff --git a/tools/check-capitalization b/tools/check-capitalization index 056d553de2..ee26f03f64 100755 --- a/tools/check-capitalization +++ b/tools/check-capitalization @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/tools/check-css b/tools/check-css index 3c5b91b16f..863c9626a2 100755 --- a/tools/check-css +++ b/tools/check-css @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function from lib.css_parser import parse, CssParserException diff --git a/tools/check-frontend-i18n b/tools/check-frontend-i18n index 4da2680e73..8d750da85e 100755 --- a/tools/check-frontend-i18n +++ b/tools/check-frontend-i18n @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/tools/check-issue-labels b/tools/check-issue-labels index d28aebc98b..d62f0857f8 100755 --- a/tools/check-issue-labels +++ b/tools/check-issue-labels @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import requests diff --git a/tools/check-provision b/tools/check-provision index 571b38c61c..0d4d4c8aca 100755 --- a/tools/check-provision +++ b/tools/check-provision @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/tools/check-templates b/tools/check-templates index b7ff4be12a..c2a11d71ce 100755 --- a/tools/check-templates +++ b/tools/check-templates @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function from lib.template_parser import validate diff --git a/tools/check-urls b/tools/check-urls index cae048bfee..61d942700a 100755 --- a/tools/check-urls +++ b/tools/check-urls @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/tools/clean-emoji-cache b/tools/clean-emoji-cache index be473cc3ea..539ac7fb6e 100755 --- a/tools/clean-emoji-cache +++ b/tools/clean-emoji-cache @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function import os diff --git a/tools/clean-npm-cache b/tools/clean-npm-cache index 2996a5dc86..41f2a1a032 100755 --- a/tools/clean-npm-cache +++ b/tools/clean-npm-cache @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function import os diff --git a/tools/clean-venv-cache b/tools/clean-venv-cache index e0670f6308..8cecda3257 100755 --- a/tools/clean-venv-cache +++ b/tools/clean-venv-cache @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function import glob diff --git a/tools/compile-handlebars-templates b/tools/compile-handlebars-templates index 2e1944922f..c1eccdff43 100755 --- a/tools/compile-handlebars-templates +++ b/tools/compile-handlebars-templates @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/tools/create-test-api-docs b/tools/create-test-api-docs index 2e83d325a0..047866bd39 100755 --- a/tools/create-test-api-docs +++ b/tools/create-test-api-docs @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import diff --git a/tools/diagnose b/tools/diagnose index 09dfa6bbb4..2cec7aa84a 100755 --- a/tools/diagnose +++ b/tools/diagnose @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import diff --git a/tools/documentation_crawler/documentation_crawler/spiders/check_documentation.py b/tools/documentation_crawler/documentation_crawler/spiders/check_documentation.py index ca55c5efe0..d37ca96adf 100755 --- a/tools/documentation_crawler/documentation_crawler/spiders/check_documentation.py +++ b/tools/documentation_crawler/documentation_crawler/spiders/check_documentation.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os diff --git a/tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py b/tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py index dfd4647c26..4e7cc32033 100644 --- a/tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py +++ b/tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os diff --git a/tools/documentation_crawler/documentation_crawler/spiders/common/spiders.py b/tools/documentation_crawler/documentation_crawler/spiders/common/spiders.py index 408504f704..5e67433c6f 100644 --- a/tools/documentation_crawler/documentation_crawler/spiders/common/spiders.py +++ b/tools/documentation_crawler/documentation_crawler/spiders/common/spiders.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import logging diff --git a/tools/find-add-class b/tools/find-add-class index 28a4feca62..a533c1281a 100755 --- a/tools/find-add-class +++ b/tools/find-add-class @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/tools/get-handlebar-vars b/tools/get-handlebar-vars index a273256710..721c3bec66 100755 --- a/tools/get-handlebar-vars +++ b/tools/get-handlebar-vars @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import import sys diff --git a/tools/html-grep b/tools/html-grep index 21c7c7ce74..2b5b82a651 100755 --- a/tools/html-grep +++ b/tools/html-grep @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function from lib.html_grep import grep diff --git a/tools/js-dep-visualizer.py b/tools/js-dep-visualizer.py index 232c32a4f0..eacb191d73 100755 --- a/tools/js-dep-visualizer.py +++ b/tools/js-dep-visualizer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ $ ./tools/js-dep-visualizer.py $ dot -Tpng var/zulip-deps.dot -o var/zulip-deps.png diff --git a/tools/lib/provision.py b/tools/lib/provision.py index 353de3df88..66cfe8e1c9 100755 --- a/tools/lib/provision.py +++ b/tools/lib/provision.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os import sys diff --git a/tools/lib/sanity_check.py b/tools/lib/sanity_check.py index bc31cc3182..1d29251cf5 100644 --- a/tools/lib/sanity_check.py +++ b/tools/lib/sanity_check.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os diff --git a/tools/lint b/tools/lint index 5f4e173bc2..8a624a95a5 100755 --- a/tools/lint +++ b/tools/lint @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import import logging diff --git a/tools/lister.py b/tools/lister.py index 6e8e547b58..f9bdccbe9f 100755 --- a/tools/lister.py +++ b/tools/lister.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import diff --git a/tools/minify-js b/tools/minify-js index 35249eefee..e4fb070104 100755 --- a/tools/minify-js +++ b/tools/minify-js @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Minifies JavaScripts, creating source maps diff --git a/tools/pretty-print-html b/tools/pretty-print-html index 9bed6092e9..2e191c256a 100755 --- a/tools/pretty-print-html +++ b/tools/pretty-print-html @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function from typing import List diff --git a/tools/renumber-migrations b/tools/renumber-migrations index 2dc657347e..7cf6ae9818 100755 --- a/tools/renumber-migrations +++ b/tools/renumber-migrations @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/tools/replace-tarball-shebang b/tools/replace-tarball-shebang index 481f919e19..c20e645896 100755 --- a/tools/replace-tarball-shebang +++ b/tools/replace-tarball-shebang @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function diff --git a/tools/review b/tools/review index b9b8c0eb10..9033f8cd28 100755 --- a/tools/review +++ b/tools/review @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import subprocess diff --git a/tools/run-dev-queue-processors b/tools/run-dev-queue-processors index d8437d6c77..470f2e5cee 100755 --- a/tools/run-dev-queue-processors +++ b/tools/run-dev-queue-processors @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # This script is only meant to be run from run-dev.py, which sets up the # environment correctly and passes the correct arguments for manage.py. It is a diff --git a/tools/run-dev.py b/tools/run-dev.py index c35c1a937f..f687a7ff8f 100755 --- a/tools/run-dev.py +++ b/tools/run-dev.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import diff --git a/tools/run-mypy b/tools/run-mypy index 10c23be66d..07ff87ee47 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/tools/send_github_payloads.py b/tools/send_github_payloads.py index f889a5cfed..a9070d8e8b 100755 --- a/tools/send_github_payloads.py +++ b/tools/send_github_payloads.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import os import simplejson diff --git a/tools/setup/build_pygments_data.py b/tools/setup/build_pygments_data.py index bdc102409f..2c1fa29cec 100755 --- a/tools/setup/build_pygments_data.py +++ b/tools/setup/build_pygments_data.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from pygments.lexers import get_all_lexers import json diff --git a/tools/setup/emoji/build_emoji b/tools/setup/emoji/build_emoji index 6e16a99fdb..8fb01f7ee3 100755 --- a/tools/setup/emoji/build_emoji +++ b/tools/setup/emoji/build_emoji @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # See docs/emoji.md for a high-level explanation of how this system # works. diff --git a/tools/setup/setup_venvs.py b/tools/setup/setup_venvs.py index 2a987eefa5..ffaa4bc46d 100755 --- a/tools/setup/setup_venvs.py +++ b/tools/setup/setup_venvs.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import sys diff --git a/tools/show-profile-results.py b/tools/show-profile-results.py index 8b7c8a86ed..9a9be06bce 100755 --- a/tools/show-profile-results.py +++ b/tools/show-profile-results.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import sys import pstats diff --git a/tools/stop_run_dev b/tools/stop_run_dev index c9ff534c19..04b611f346 100755 --- a/tools/stop_run_dev +++ b/tools/stop_run_dev @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os diff --git a/tools/test-api b/tools/test-api index ea37c4f748..aa2aed4503 100755 --- a/tools/test-api +++ b/tools/test-api @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import import os diff --git a/tools/test-backend b/tools/test-backend index 83bb795b3e..71378be6b6 100755 --- a/tools/test-backend +++ b/tools/test-backend @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import diff --git a/tools/test-help-documentation.py b/tools/test-help-documentation.py index e41c834a17..56623ae8ab 100755 --- a/tools/test-help-documentation.py +++ b/tools/test-help-documentation.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import import optparse diff --git a/tools/test-js-with-node b/tools/test-js-with-node index ff67fd745c..daad0072da 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import optparse import os diff --git a/tools/test-queue-worker-reload b/tools/test-queue-worker-reload index bb95bd0f5c..54ade835c2 100755 --- a/tools/test-queue-worker-reload +++ b/tools/test-queue-worker-reload @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import diff --git a/tools/test-run-dev b/tools/test-run-dev index c7b2230f8d..b1f75f3ec3 100755 --- a/tools/test-run-dev +++ b/tools/test-run-dev @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import diff --git a/tools/test-tools b/tools/test-tools index fd6c424026..92f9e441ce 100755 --- a/tools/test-tools +++ b/tools/test-tools @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function diff --git a/tools/test_user_agent_parsing.py b/tools/test_user_agent_parsing.py index 59c8353b04..d7042974ab 100755 --- a/tools/test_user_agent_parsing.py +++ b/tools/test_user_agent_parsing.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import re from collections import defaultdict diff --git a/tools/update-authors-json b/tools/update-authors-json index f78313326f..1cd7da484f 100755 --- a/tools/update-authors-json +++ b/tools/update-authors-json @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Fetch contributors data from Github using their API, convert it to structured JSON data for the /about page authors section. diff --git a/tools/update-prod-static b/tools/update-prod-static index e28b2b13c5..1d0c2cd2e2 100755 --- a/tools/update-prod-static +++ b/tools/update-prod-static @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Updates static files for production. diff --git a/tools/webpack b/tools/webpack index e790f60cbc..dbe144df99 100755 --- a/tools/webpack +++ b/tools/webpack @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import import argparse diff --git a/tools/zulip-export/zulip-export b/tools/zulip-export/zulip-export index f6cfd25843..ee8f8d9b28 100755 --- a/tools/zulip-export/zulip-export +++ b/tools/zulip-export/zulip-export @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2014 Dropbox, Inc. diff --git a/zerver/management/commands/deliver_email.py b/zerver/management/commands/deliver_email.py index 53794f9e6b..bfcf6c1af4 100755 --- a/zerver/management/commands/deliver_email.py +++ b/zerver/management/commands/deliver_email.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """\ Deliver email messages that have been queued by various things diff --git a/zerver/management/commands/email_mirror.py b/zerver/management/commands/email_mirror.py index 919b1c395b..6a782b1f0e 100755 --- a/zerver/management/commands/email_mirror.py +++ b/zerver/management/commands/email_mirror.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Forward messages sent to the configured email gateway to Zulip. diff --git a/zerver/management/commands/print_email_delivery_backlog.py b/zerver/management/commands/print_email_delivery_backlog.py index f3f148aa49..87a10cc0ca 100755 --- a/zerver/management/commands/print_email_delivery_backlog.py +++ b/zerver/management/commands/print_email_delivery_backlog.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Shows backlog count of ScheduledEmail diff --git a/zerver/views/test_emails.py b/zerver/views/test_emails.py index 7807f2f9b1..4319aea8b9 100755 --- a/zerver/views/test_emails.py +++ b/zerver/views/test_emails.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function