[Python-checkins] bpo-34011: Update code copying DLLs and init.tcl into venvs. (GH-8253)

Vinay Sajip webhook-mailer at python.org
Fri Jul 20 12:07:41 EDT 2018


https://github.com/python/cpython/commit/94487d45707772723ef19e86700a40a12743baa1
commit: 94487d45707772723ef19e86700a40a12743baa1
branch: master
author: Vinay Sajip <vinay_sajip at yahoo.co.uk>
committer: GitHub <noreply at github.com>
date: 2018-07-20T17:07:38+01:00
summary:

bpo-34011: Update code copying DLLs and init.tcl into venvs. (GH-8253)

files:
A Misc/NEWS.d/next/Windows/2018-07-11-15-58-06.bpo-34011.Ho_d5T.rst
M Lib/venv/__init__.py

diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 716129d13987..e0ab241f77c5 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -9,6 +9,7 @@
 import shutil
 import subprocess
 import sys
+import sysconfig
 import types
 
 logger = logging.getLogger(__name__)
@@ -207,7 +208,10 @@ def setup_python(self, context):
                     copier(context.env_exe, path, relative_symlinks_ok=True)
                     if not os.path.islink(path):
                         os.chmod(path, 0o755)
-        else:
+        elif sysconfig.is_python_build(True):
+            # See bpo-34011. This copying code should only be needed when a
+            # venv is created from a source Python build (i.e. not an installed
+            # Python)
             subdir = 'DLLs'
             include = self.include_binary
             files = [f for f in os.listdir(dirname) if include(f)]
diff --git a/Misc/NEWS.d/next/Windows/2018-07-11-15-58-06.bpo-34011.Ho_d5T.rst b/Misc/NEWS.d/next/Windows/2018-07-11-15-58-06.bpo-34011.Ho_d5T.rst
new file mode 100644
index 000000000000..8fcf8b51081b
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2018-07-11-15-58-06.bpo-34011.Ho_d5T.rst
@@ -0,0 +1,4 @@
+A suite of code has been changed which copied across DLLs and init.tcl from
+the running Python location into a venv being created. These copies are needed
+only when running from a Python source build, and the copying code is now only
+run when that is the case, rather than whenever a venv is created.



More information about the Python-checkins mailing list