From a10d4adc25500e160c71d0d3f32a6f3ebbf3c9fd Mon Sep 17 00:00:00 2001
From: teor <teor@torproject.org>
Date: Wed, 27 Mar 2019 11:07:55 +1000
Subject: [PATCH] Stop assuming that /usr/bin/python3 exists

For scripts that work with python2, use /usr/bin/python.
Otherwise, use /usr/bin/env python3.

Fixes bug 29913; bugfix on 0.2.5.3-alpha.
---
 changes/ticket29913                      | 4 ++++
 scripts/maint/checkIncludes.py           | 2 +-
 scripts/maint/practracker/practracker.py | 2 +-
 scripts/maint/rectify_include_paths.py   | 2 +-
 src/config/mmdb-convert.py               | 2 +-
 src/test/ope_ref.py                      | 2 +-
 6 files changed, 9 insertions(+), 5 deletions(-)
 create mode 100644 changes/ticket29913

diff --git a/changes/ticket29913 b/changes/ticket29913
new file mode 100644
index 0000000000..a713b0ccef
--- /dev/null
+++ b/changes/ticket29913
@@ -0,0 +1,4 @@
+  o Minor bugfixes (python):
+    - Stop assuming that /usr/bin/python3 exists. For scripts that work with
+      python2, use /usr/bin/python. Otherwise, use /usr/bin/env python3.
+      Fixes bug 29913; bugfix on 0.2.5.3-alpha.
diff --git a/scripts/maint/checkIncludes.py b/scripts/maint/checkIncludes.py
index 3afd9bbebe..ec9350b9b1 100755
--- a/scripts/maint/checkIncludes.py
+++ b/scripts/maint/checkIncludes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/python
 # Copyright 2018 The Tor Project, Inc.  See LICENSE file for licensing info.
 
 """This script looks through all the directories for files matching *.c or
diff --git a/scripts/maint/practracker/practracker.py b/scripts/maint/practracker/practracker.py
index 22cb46c749..febb14639d 100755
--- a/scripts/maint/practracker/practracker.py
+++ b/scripts/maint/practracker/practracker.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/python
 
 """
 Best-practices tracker for Tor source code.
diff --git a/scripts/maint/rectify_include_paths.py b/scripts/maint/rectify_include_paths.py
index 401fadae6d..d1a2328ca6 100755
--- a/scripts/maint/rectify_include_paths.py
+++ b/scripts/maint/rectify_include_paths.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/python
 
 import os
 import os.path
diff --git a/src/config/mmdb-convert.py b/src/config/mmdb-convert.py
index 706a8b03cc..b861e9433e 100644
--- a/src/config/mmdb-convert.py
+++ b/src/config/mmdb-convert.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/python
 
 #   This software has been dedicated to the public domain under the CC0
 #   public domain dedication.
diff --git a/src/test/ope_ref.py b/src/test/ope_ref.py
index f9bd97c546..b2f7012563 100644
--- a/src/test/ope_ref.py
+++ b/src/test/ope_ref.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # Copyright 2018-2019, The Tor Project, Inc. See LICENSE for licensing info.
 
 # Reference implementation for our rudimentary OPE code, used to
-- 
GitLab