[Python-checkins] bpo-39656: Ensure `bin/python3.#` is always present in virtual environments on POSIX (GH-19030)

Anthony Sottile webhook-mailer at python.org
Tue Mar 17 03:29:18 EDT 2020


https://github.com/python/cpython/commit/58ec58a42bece5b2804b178c7a6a7e67328465db
commit: 58ec58a42bece5b2804b178c7a6a7e67328465db
branch: master
author: Anthony Sottile <asottile at umich.edu>
committer: GitHub <noreply at github.com>
date: 2020-03-17T07:29:11Z
summary:

bpo-39656: Ensure `bin/python3.#` is always present in virtual environments on POSIX (GH-19030)

files:
A Misc/NEWS.d/next/Library/2020-03-16-11-38-45.bpo-39656.MaNOgm.rst
M Lib/venv/__init__.py

diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index a220ef784c134..8009deb3ea700 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -243,7 +243,7 @@ def setup_python(self, context):
             copier(context.executable, path)
             if not os.path.islink(path):
                 os.chmod(path, 0o755)
-            for suffix in ('python', 'python3'):
+            for suffix in ('python', 'python3', f'python3.{sys.version_info[1]}'):
                 path = os.path.join(binpath, suffix)
                 if not os.path.exists(path):
                     # Issue 18807: make copies if
diff --git a/Misc/NEWS.d/next/Library/2020-03-16-11-38-45.bpo-39656.MaNOgm.rst b/Misc/NEWS.d/next/Library/2020-03-16-11-38-45.bpo-39656.MaNOgm.rst
new file mode 100644
index 0000000000000..937d162e4f0ec
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-03-16-11-38-45.bpo-39656.MaNOgm.rst
@@ -0,0 +1,2 @@
+Ensure ``bin/python3.#`` is always present in virtual environments on POSIX
+platforms - by Anthony Sottile.



More information about the Python-checkins mailing list