[Python-checkins] bpo-36441: Fixes creating a venv when debug binaries are installed. (#12566)
Steve Dower
webhook-mailer at python.org
Wed Mar 27 11:14:59 EDT 2019
https://github.com/python/cpython/commit/4a9a505d6f2474a570422dad89f8d1b344d6cd36
commit: 4a9a505d6f2474a570422dad89f8d1b344d6cd36
branch: master
author: Steve Dower <steve.dower at microsoft.com>
committer: GitHub <noreply at github.com>
date: 2019-03-27T08:14:53-07:00
summary:
bpo-36441: Fixes creating a venv when debug binaries are installed. (#12566)
files:
A Misc/NEWS.d/next/Windows/2019-03-26-11-46-15.bpo-36441.lYjGF1.rst
M Lib/venv/__init__.py
M Tools/msi/lib/lib_files.wxs
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 5e6d375e95a7..4a49b240b8e2 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -195,6 +195,9 @@ def symlink_or_copy(self, src, dst, relative_symlinks_ok=False):
src = os.path.join(os.path.dirname(src), basename + ext)
else:
src = srcfn
+ if not os.path.exists(src):
+ logger.warning('Unable to copy %r', src)
+ return
shutil.copyfile(src, dst)
diff --git a/Misc/NEWS.d/next/Windows/2019-03-26-11-46-15.bpo-36441.lYjGF1.rst b/Misc/NEWS.d/next/Windows/2019-03-26-11-46-15.bpo-36441.lYjGF1.rst
new file mode 100644
index 000000000000..b27abff62098
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2019-03-26-11-46-15.bpo-36441.lYjGF1.rst
@@ -0,0 +1 @@
+Fixes creating a venv when debug binaries are installed.
diff --git a/Tools/msi/lib/lib_files.wxs b/Tools/msi/lib/lib_files.wxs
index a9952bdac4db..251f9b1aeb86 100644
--- a/Tools/msi/lib/lib_files.wxs
+++ b/Tools/msi/lib/lib_files.wxs
@@ -69,6 +69,15 @@
</Fragment>
<Fragment>
+ <!-- The auto-generated directory is not available when building debug binaries -->
+ <DirectoryRef Id="Lib">
+ <Directory Id="Lib_venv__d" Name="venv">
+ <Directory Id="Lib_venv_scripts__d" Name="scripts">
+ <Directory Id="Lib_venv_scripts_nt__d" Name="nt" />
+ </Directory>
+ </Directory>
+ </DirectoryRef>
+
<ComponentGroup Id="lib_extensions_d">
<?foreach ext in $(var.exts)?>
@@ -87,6 +96,12 @@
<Component Id="sqlite3_d.pdb" Directory="DLLs" Guid="*">
<File Name="sqlite3_d.pdb" KeyPath="yes" />
</Component>
+ <Component Id="venvlauncher_d.exe" Directory="Lib_venv_scripts_nt__d" Guid="*">
+ <File Name="python_d.exe" Source="venvlauncher_d.exe" KeyPath="yes" />
+ </Component>
+ <Component Id="venvwlauncher_d.exe" Directory="Lib_venv_scripts_nt__d" Guid="*">
+ <File Name="pythonw_d.exe" Source="venvwlauncher_d.exe" KeyPath="yes" />
+ </Component>
</ComponentGroup>
</Fragment>
<Fragment>
More information about the Python-checkins
mailing list