]> granicus.if.org Git - python/commitdiff
bpo-36441: Fixes creating a venv when debug binaries are installed. (#12566)
authorSteve Dower <steve.dower@microsoft.com>
Wed, 27 Mar 2019 15:14:53 +0000 (08:14 -0700)
committerGitHub <noreply@github.com>
Wed, 27 Mar 2019 15:14:53 +0000 (08:14 -0700)
Lib/venv/__init__.py
Misc/NEWS.d/next/Windows/2019-03-26-11-46-15.bpo-36441.lYjGF1.rst [new file with mode: 0644]
Tools/msi/lib/lib_files.wxs

index 5e6d375e95a71c59793b6f03dfe0eb169ba53164..4a49b240b8e2171535ed789c3ee77b73558148a1 100644 (file)
@@ -195,6 +195,9 @@ class EnvBuilder:
                     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 (file)
index 0000000..b27abff
--- /dev/null
@@ -0,0 +1 @@
+Fixes creating a venv when debug binaries are installed.
index a9952bdac4db9164b4911a63d8f61054fb2224ea..251f9b1aeb86761a89c0905752eba87fc4418cf6 100644 (file)
     </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)?>
             
             <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>