[Python-checkins] [3.9] bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216) (GH-30033)

vsajip webhook-mailer at python.org
Fri Dec 10 13:06:15 EST 2021


https://github.com/python/cpython/commit/bad16f0cf71a6b11ef62f86be6b3d3567cd70a16
commit: bad16f0cf71a6b11ef62f86be6b3d3567cd70a16
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: vsajip <vinay_sajip at yahoo.co.uk>
date: 2021-12-10T18:06:07Z
summary:

[3.9] bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216) (GH-30033)

Co-authored-by: Ian Norton <inorton at gmail.com>

files:
M Lib/venv/__init__.py

diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index ce1f5d710ad76..6f1af294ae63e 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -281,8 +281,9 @@ def setup_python(self, context):
                         os.path.normcase(f).startswith(('python', 'vcruntime'))
                     ]
             else:
-                suffixes = ['python.exe', 'python_d.exe', 'pythonw.exe',
-                            'pythonw_d.exe']
+                suffixes = {'python.exe', 'python_d.exe', 'pythonw.exe', 'pythonw_d.exe'}
+                base_exe = os.path.basename(context.env_exe)
+                suffixes.add(base_exe)
 
             for suffix in suffixes:
                 src = os.path.join(dirname, suffix)



More information about the Python-checkins mailing list