Skip to content

Commit 2caf3ac

Browse files
Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them. Disable executable bits and shebang lines in test and benchmark files in order to prevent using a random system python, and in source files of modules which don't provide command line interface. Fixed shebang lines in the unittestgui and checkpip scripts.
2 parents 64f218a + f712529 commit 2caf3ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+8
-70
lines changed

Lib/difflib.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#! /usr/bin/env python3
2-
31
"""
42
Module difflib -- helpers for computing deltas between objects.
53

Lib/http/cookies.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/usr/bin/env python3
2-
#
3-
41
####
52
# Copyright 2000 by Timothy O'Malley <[email protected]>
63
#

Lib/mailbox.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#! /usr/bin/env python3
2-
31
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""
42

53
# Notes for authors of new mailbox subclasses:

Lib/operator.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
"""
32
Operator Interface
43

Lib/smtplib.py

100644100755
File mode changed.

Lib/tarfile.py

100644100755
File mode changed.

Lib/test/_test_multiprocessing.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
#
42
# Unit tests for the multiprocessing package
53
#

Lib/test/multibytecodec_support.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# multibytecodec_support.py
43
# Common Unittest Routines for CJK codecs

Lib/test/ssltests.py

100755100644
File mode changed.

Lib/test/test___future__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#! /usr/bin/env python3
21
import unittest
32
from test import support
43
import __future__

Lib/test/test_array.py

100755100644
-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#! /usr/bin/env python3
21
"""Test the arraymodule.
32
Roger E. Masse
43
"""

Lib/test/test_binhex.py

100755100644
-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#! /usr/bin/env python3
21
"""Test script for the binhex C module
32
43
Uses the mechanism of the python binhex module

Lib/test/test_bz2.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
from test import support
32
from test.support import bigmemtest, _4G
43

Lib/test/test_cmd.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
"""
32
Test script for the 'cmd' module
43
Original by Michael Schneider

Lib/test/test_codecencodings_cn.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_codecencodings_cn.py
43
# Codec encoding tests for PRC encodings.

Lib/test/test_codecencodings_hk.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_codecencodings_hk.py
43
# Codec encoding tests for HongKong encodings.

Lib/test/test_codecencodings_iso2022.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
#
31
# Codec encoding tests for ISO 2022 encodings.
42

53
from test import support

Lib/test/test_codecencodings_jp.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_codecencodings_jp.py
43
# Codec encoding tests for Japanese encodings.

Lib/test/test_codecencodings_kr.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_codecencodings_kr.py
43
# Codec encoding tests for ROK encodings.

Lib/test/test_codecencodings_tw.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_codecencodings_tw.py
43
# Codec encoding tests for ROC encodings.

Lib/test/test_codecmaps_cn.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_codecmaps_cn.py
43
# Codec mapping tests for PRC encodings

Lib/test/test_codecmaps_hk.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_codecmaps_hk.py
43
# Codec mapping tests for HongKong encodings

Lib/test/test_codecmaps_jp.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_codecmaps_jp.py
43
# Codec mapping tests for Japanese encodings

Lib/test/test_codecmaps_kr.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_codecmaps_kr.py
43
# Codec mapping tests for ROK encodings

Lib/test/test_codecmaps_tw.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_codecmaps_tw.py
43
# Codec mapping tests for ROC encodings

Lib/test/test_dbm.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#! /usr/bin/env python3
21
"""Test script for the dbm.open function based on testdumbdbm.py"""
32

43
import os

Lib/test/test_dbm_dumb.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#! /usr/bin/env python3
21
"""Test script for the dumbdbm module
32
Original by Roger E. Masse
43
"""

Lib/test/test_eof.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#! /usr/bin/env python3
21
"""test script for a few new invalid token catches"""
32

43
import unittest

Lib/test/test_errno.py

100755100644
-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#! /usr/bin/env python3
21
"""Test the errno module
32
Roger E. Masse
43
"""

Lib/test/test_gzip.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#! /usr/bin/env python3
21
"""Test script for the gzip module.
32
"""
43

Lib/test/test_keywordonlyarg.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
"""Unit tests for the keyword only argument specified in PEP 3102."""
42

53
__author__ = "Jiwon Seo"

Lib/test/test_logging.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
#
31
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
42
#
53
# Permission to use, copy, modify, and distribute this software and its

Lib/test/test_marshal.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
from test import support
42
import array
53
import io

Lib/test/test_multibytecodec.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
#
32
# test_multibytecodec.py
43
# Unit test for multibytecodec itself

Lib/test/test_pathlib.py

100755100644
File mode changed.

Lib/test/test_popen.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#! /usr/bin/env python3
21
"""Basic tests for os.popen()
32
43
Particularly useful for platforms that fake popen.

Lib/test/test_random.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
import unittest
42
import unittest.mock
53
import random

Lib/test/test_sched.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
import queue
42
import sched
53
import time

Lib/test/test_smtpnet.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
import unittest
42
from test import support
53
import smtplib

Lib/test/test_socket.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
import unittest
42
from test import support
53

Lib/test/test_support.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
import importlib
42
import shutil
53
import sys

Lib/test/test_tcl.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
import unittest
42
import sys
53
import os

Lib/test/test_urllib2_localnet.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
import os
42
import email
53
import urllib.parse

Lib/test/test_urllib2net.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
import unittest
42
from test import support
53
from test.test_urllib2 import sanepathname2url

Lib/test/test_urllibnet.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
import unittest
42
from test import support
53

Lib/test/test_urlparse.py

100755100644
-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#! /usr/bin/env python3
2-
31
from test import support
42
import unittest
53
import urllib.parse

Lib/test/test_userstring.py

100755100644
-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
# UserString is a wrapper around the native builtin string type.
32
# UserString instances should behave similar to builtin string objects.
43

Lib/test/test_with.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
"""Unit tests for the with statement specified in PEP 343."""
42

53

Lib/test/test_xmlrpc_net.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
import collections.abc
42
import errno
53
import socket

Lib/timeit.py

100644100755
File mode changed.

Lib/token.py

100755100644
File mode changed.

Lib/trace.py

100644100755
File mode changed.

Lib/webbrowser.py

100644100755
File mode changed.

Mac/Tools/bundlebuilder.py

100644100755
File mode changed.

Mac/Tools/plistlib_generate_testdata.py

100644100755
File mode changed.

Misc/NEWS

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ Tests
8888
Tools/Demos
8989
-----------
9090

91+
- Issue #19936: Added executable bits or shebang lines to Python scripts which
92+
requires them. Disable executable bits and shebang lines in test and
93+
benchmark files in order to prevent using a random system python, and in
94+
source files of modules which don't provide command line interface. Fixed
95+
shebang lines in the unittestgui and checkpip scripts.
96+
9197
- Issue #20268: Argument Clinic now supports cloning the parameters and
9298
return converter of existing functions.
9399

Tools/clinic/clinic_test.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
#
31
# Argument Clinic
42
# Copyright 2012-2013 by Larry Hastings.
53
# Licensed to the PSF under a contributor agreement.

Tools/gdb/libpython.py

100644100755
File mode changed.

Tools/i18n/makelocalealias.py

100644100755
File mode changed.

Tools/scripts/checkpip.py

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#/usr/bin/env python3
1+
#!/usr/bin/env python3
22
"""
33
Checks that the version of the projects bundled in ensurepip are the latest
44
versions available.

Tools/scripts/win_add2path.py

100755100644
File mode changed.

Tools/stringbench/stringbench.py

100755100644
File mode changed.

Tools/unittestgui/unittestgui.py

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
"""
33
GUI framework and application for use with Python unit testing framework.
44
Execute tests written using the framework provided by the 'unittest' module.

0 commit comments

Comments
 (0)