[tor-commits] [tor/master] Stop assuming that /usr/bin/python exists

dgoulet at torproject.org dgoulet at torproject.org
Tue Feb 18 14:06:56 UTC 2020


commit 674a821fbbdc9ca0a3af02129d463ec1e700094f
Author: Panagiotis Vasilopoulos <hello at alwayslivid.com>
Date:   Sun Feb 16 21:58:01 2020 +0200

    Stop assuming that /usr/bin/python exists
    
    Fixes 33192
---
 changes/ticket33192                            | 5 +++++
 contrib/client-tools/tor-resolve.py            | 2 +-
 scripts/codegen/fuzzing_include_am.py          | 2 +-
 scripts/codegen/gen_server_ciphers.py          | 2 +-
 scripts/codegen/get_mozilla_ciphers.py         | 2 +-
 scripts/codegen/makedesc.py                    | 2 +-
 scripts/maint/annotate_ifdef_directives.py     | 2 +-
 scripts/maint/checkIncludes.py                 | 2 +-
 scripts/maint/format_changelog.py              | 2 +-
 scripts/maint/lintChanges.py                   | 2 +-
 scripts/maint/locatemissingdoxygen.py          | 2 +-
 scripts/maint/practracker/includes.py          | 2 +-
 scripts/maint/practracker/metrics.py           | 2 +-
 scripts/maint/practracker/practracker.py       | 2 +-
 scripts/maint/practracker/practracker_tests.py | 2 +-
 scripts/maint/rectify_include_paths.py         | 2 +-
 scripts/maint/redox.py                         | 2 +-
 scripts/maint/sortChanges.py                   | 2 +-
 18 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/changes/ticket33192 b/changes/ticket33192
new file mode 100644
index 000000000..97f976226
--- /dev/null
+++ b/changes/ticket33192
@@ -0,0 +1,5 @@
+  o Minor feature (python):
+    - Stop assuming that /usr/bin/python exists. Instead of using a
+      hardcoded path in scripts that still use Python 2, use /usr/bin/env,
+      similarly to the scripts that use Python 3. Fixes bug 33192; bugfix
+      on 0.4.2.
\ No newline at end of file
diff --git a/contrib/client-tools/tor-resolve.py b/contrib/client-tools/tor-resolve.py
index 356219371..85e7d2d8b 100755
--- a/contrib/client-tools/tor-resolve.py
+++ b/contrib/client-tools/tor-resolve.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Future imports for Python 2.7, mandatory in 3.0
 from __future__ import division
diff --git a/scripts/codegen/fuzzing_include_am.py b/scripts/codegen/fuzzing_include_am.py
index aa3ba49a7..ae5056307 100755
--- a/scripts/codegen/fuzzing_include_am.py
+++ b/scripts/codegen/fuzzing_include_am.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Future imports for Python 2.7, mandatory in 3.0
 from __future__ import division
diff --git a/scripts/codegen/gen_server_ciphers.py b/scripts/codegen/gen_server_ciphers.py
index 3b7795224..8c88e54a1 100755
--- a/scripts/codegen/gen_server_ciphers.py
+++ b/scripts/codegen/gen_server_ciphers.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # Copyright 2014-2019, The Tor Project, Inc
 # See LICENSE for licensing information
 
diff --git a/scripts/codegen/get_mozilla_ciphers.py b/scripts/codegen/get_mozilla_ciphers.py
index 165105736..ff01dd871 100755
--- a/scripts/codegen/get_mozilla_ciphers.py
+++ b/scripts/codegen/get_mozilla_ciphers.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # coding=utf-8
 # Copyright 2011-2019, The Tor Project, Inc
 # original version by Arturo Filastò
diff --git a/scripts/codegen/makedesc.py b/scripts/codegen/makedesc.py
index af926a643..48d1d31a0 100644
--- a/scripts/codegen/makedesc.py
+++ b/scripts/codegen/makedesc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # Copyright 2014-2019, The Tor Project, Inc.
 # See LICENSE for license information
 
diff --git a/scripts/maint/annotate_ifdef_directives.py b/scripts/maint/annotate_ifdef_directives.py
index cd70b55c8..9ca090d59 100755
--- a/scripts/maint/annotate_ifdef_directives.py
+++ b/scripts/maint/annotate_ifdef_directives.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # Copyright (c) 2017-2019, The Tor Project, Inc.
 # See LICENSE for licensing information
 
diff --git a/scripts/maint/checkIncludes.py b/scripts/maint/checkIncludes.py
index 2ca46347f..ae0ccb9e1 100755
--- a/scripts/maint/checkIncludes.py
+++ b/scripts/maint/checkIncludes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # Copyright 2018 The Tor Project, Inc.  See LICENSE file for licensing info.
 
 # This file is no longer here; see practracker/includes.py for this
diff --git a/scripts/maint/format_changelog.py b/scripts/maint/format_changelog.py
index 32085c360..7cf55a0d9 100755
--- a/scripts/maint/format_changelog.py
+++ b/scripts/maint/format_changelog.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # Copyright (c) 2014-2019, The Tor Project, Inc.
 # See LICENSE for licensing information
 #
diff --git a/scripts/maint/lintChanges.py b/scripts/maint/lintChanges.py
index 88a865a57..eced70ae7 100755
--- a/scripts/maint/lintChanges.py
+++ b/scripts/maint/lintChanges.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Future imports for Python 2.7, mandatory in 3.0
 from __future__ import division
diff --git a/scripts/maint/locatemissingdoxygen.py b/scripts/maint/locatemissingdoxygen.py
index 773397735..a2844346d 100755
--- a/scripts/maint/locatemissingdoxygen.py
+++ b/scripts/maint/locatemissingdoxygen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 """
   This script parses the stderr output of doxygen and looks for undocumented
diff --git a/scripts/maint/practracker/includes.py b/scripts/maint/practracker/includes.py
index fe0f32e25..e9b02c35b 100755
--- a/scripts/maint/practracker/includes.py
+++ b/scripts/maint/practracker/includes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env 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/metrics.py b/scripts/maint/practracker/metrics.py
index ae88b84f3..300a4501a 100644
--- a/scripts/maint/practracker/metrics.py
+++ b/scripts/maint/practracker/metrics.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Implementation of various source code metrics.
 # These are currently ad-hoc string operations and regexps.
diff --git a/scripts/maint/practracker/practracker.py b/scripts/maint/practracker/practracker.py
index 6149fb79c..b6a1f7813 100755
--- a/scripts/maint/practracker/practracker.py
+++ b/scripts/maint/practracker/practracker.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 """
 Best-practices tracker for Tor source code.
diff --git a/scripts/maint/practracker/practracker_tests.py b/scripts/maint/practracker/practracker_tests.py
index 8d0418880..e03c9e05a 100755
--- a/scripts/maint/practracker/practracker_tests.py
+++ b/scripts/maint/practracker/practracker_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 """Some simple tests for practracker metrics"""
 
diff --git a/scripts/maint/rectify_include_paths.py b/scripts/maint/rectify_include_paths.py
index 111cf816c..c6c502671 100755
--- a/scripts/maint/rectify_include_paths.py
+++ b/scripts/maint/rectify_include_paths.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Future imports for Python 2.7, mandatory in 3.0
 from __future__ import division
diff --git a/scripts/maint/redox.py b/scripts/maint/redox.py
index 3ad3e3f1b..12b02c8a4 100755
--- a/scripts/maint/redox.py
+++ b/scripts/maint/redox.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 #  Copyright (c) 2008-2019, The Tor Project, Inc.
 #  See LICENSE for licensing information.
diff --git a/scripts/maint/sortChanges.py b/scripts/maint/sortChanges.py
index 2e049b1e5..5f6324e38 100755
--- a/scripts/maint/sortChanges.py
+++ b/scripts/maint/sortChanges.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # Copyright (c) 2014-2019, The Tor Project, Inc.
 # See LICENSE for licensing information
 





More information about the tor-commits mailing list