diff options
author | Steve Dower <steve.dower@microsoft.com> | 2016-12-12 19:17:59 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2016-12-12 19:17:59 (GMT) |
commit | 10beb3cfef97d162b49b95c538c69c17a20bc910 (patch) | |
tree | 313bcc04cd62c40998c4da5f48a01533a981ee2a | |
parent | 452b3a6a3e9e4ca99d9c6caff367fce749a7ec58 (diff) | |
download | cpython-10beb3cfef97d162b49b95c538c69c17a20bc910.zip cpython-10beb3cfef97d162b49b95c538c69c17a20bc910.tar.gz cpython-10beb3cfef97d162b49b95c538c69c17a20bc910.tar.bz2 |
Issue #28896: Disable WindowsRegistryFinder by default.
-rw-r--r-- | Lib/importlib/_bootstrap_external.py | 2 | ||||
-rw-r--r-- | Misc/NEWS | 2 | ||||
-rw-r--r-- | PCbuild/_freeze_importlib.vcxproj | 37 | ||||
-rw-r--r-- | PCbuild/pcbuild.proj | 10 | ||||
-rw-r--r-- | Python/importlib_external.h | 109 |
5 files changed, 83 insertions, 77 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index ab43446..9feec50 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -1440,6 +1440,4 @@ def _install(_bootstrap_module): _setup(_bootstrap_module) supported_loaders = _get_supported_file_loaders() sys.path_hooks.extend([FileFinder.path_hook(*supported_loaders)]) - if _os.__name__ == 'nt': - sys.meta_path.append(WindowsRegistryFinder) sys.meta_path.append(PathFinder) @@ -42,7 +42,7 @@ Library Windows ------- -- Issue #28896: Deprecate WindowsRegistryFinder +- Issue #28896: Deprecate WindowsRegistryFinder and disable it by default. Tests ----- diff --git a/PCbuild/_freeze_importlib.vcxproj b/PCbuild/_freeze_importlib.vcxproj index f7714c0..c732663 100644 --- a/PCbuild/_freeze_importlib.vcxproj +++ b/PCbuild/_freeze_importlib.vcxproj @@ -76,31 +76,44 @@ </ProjectReference> </ItemGroup> <ItemGroup> - <None Include="..\Lib\importlib\_bootstrap.py" /> + <None Include="..\Lib\importlib\_bootstrap.py"> + <IntFile>$(IntDir)importlib.g.h</IntFile> + <OutFile>$(PySourcePath)Python\importlib.h</OutFile> + </None> + <None Include="..\Lib\importlib\_bootstrap_external.py"> + <IntFile>$(IntDir)importlib_external.g.h</IntFile> + <OutFile>$(PySourcePath)Python\importlib_external.h</OutFile> + </None> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> - <Target Name="RebuildImportLib" AfterTargets="AfterBuild" Condition="$(Configuration) == 'Debug' or $(Configuration) == 'Release'"> - <Exec Command='"$(TargetPath)" "$(PySourcePath)Lib\importlib\_bootstrap.py" "$(IntDir)importlib.g.h"' /> + <Target Name="_RebuildImportLib"> + <Exec Command='"$(TargetPath)" "%(None.FullPath)" "%(None.IntFile)"' /> <PropertyGroup> - <_OldContent Condition="Exists('$(PySourcePath)Python\importlib.h')">$([System.IO.File]::ReadAllText('$(PySourcePath)Python\importlib.h').Replace(`
`, `
`))</_OldContent> - <_NewContent Condition="Exists('$(IntDir)importlib.g.h')">$([System.IO.File]::ReadAllText('$(IntDir)importlib.g.h').Replace(`
`, `
`))</_NewContent> + <_OldContent Condition="Exists($(OutTargetPath))"></_OldContent> + <_NewContent Condition="Exists($(IntTargetPath))">$([System.IO.File]::ReadAllText($(IntTargetPath)).Replace(`
`, `
`))</_NewContent> </PropertyGroup> - <Copy SourceFiles="$(IntDir)importlib.g.h" - DestinationFiles="$(PySourcePath)Python\importlib.h" - Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)'" /> + <Copy SourceFiles="%(None.IntFile)" + DestinationFiles="%(None.OutFile)" + Condition="!Exists(%(None.OutFile)) or (Exists(%(None.IntFile)) and '$([System.IO.File]::ReadAllText(%(None.OutFile)).Replace(`
`, `
`))' != '$([System.IO.File]::ReadAllText(%(None.IntFile)).Replace(`
`, `
`))')"> + <Output TaskParameter="CopiedFiles" ItemName="_Updated" /> + </Copy> - <Warning Text="importlib.h has been updated. You will need to rebuild pythoncore to see the changes." - Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)' and $(Configuration) == 'Debug'" /> - <Error Text="importlib.h has been updated. You will need to rebuild pythoncore to see the changes." - Condition="Exists('$(IntDir)importlib.g.h') and '$(_OldContent)' != '$(_NewContent)' and $(Configuration) == 'Release'" /> + <Warning Text="@(_Updated->'%(Filename)%(Extension)',', ') updated. You will need to rebuild pythoncore to see the changes." + Condition="'@(_Updated)' != '' and $(Configuration) == 'Debug'" /> + <Error Text="@(_Updated->'%(Filename)%(Extension)',', ') updated. You will need to rebuild pythoncore to see the changes." + Condition="'@(_Updated)' != '' and $(Configuration) == 'Release'" /> + </Target> + <Target Name="RebuildImportLib" AfterTargets="AfterBuild" Condition="$(Configuration) == 'Debug' or $(Configuration) == 'Release'" + DependsOnTargets="_RebuildImportLib"> </Target> <Target Name="_CleanImportLib" BeforeTargets="CoreClean"> <ItemGroup> <Clean Include="$(IntDir)importlib.g.h" /> + <Clean Include="$(IntDir)importlib_external.g.h" /> </ItemGroup> </Target> </Project> diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj index e0e6e93..c6b8487 100644 --- a/PCbuild/pcbuild.proj +++ b/PCbuild/pcbuild.proj @@ -28,7 +28,7 @@ <BuildTarget>Build</BuildTarget> <CleanTarget>Clean</CleanTarget> <CleanAllTarget>CleanAll</CleanAllTarget> - <BuildInParallel>true</BuildInParallel> + <BuildInParallel>false</BuildInParallel> </Projects2> </ItemDefinitionGroup> <ItemGroup> @@ -48,8 +48,6 @@ <Projects Include="pylauncher.vcxproj;pywlauncher.vcxproj" /> <!-- pyshellext.dll --> <Projects Include="pyshellext.vcxproj" /> - <!-- _freeze_importlib --> - <Projects Include="_freeze_importlib.vcxproj" /> <!-- Extension modules --> <ExtensionModules Include="_asyncio;_ctypes;_decimal;_elementtree;_msi;_multiprocessing;_overlapped;pyexpat;select;unicodedata;winsound" /> <!-- Extension modules that require external sources --> @@ -68,10 +66,10 @@ <BuildInParallel>false</BuildInParallel> </Projects> + <!-- _freeze_importlib --> + <Projects2 Include="_freeze_importlib.vcxproj" /> <!-- python[w].exe --> - <Projects2 Include="python.vcxproj;pythonw.vcxproj"> - <BuildInParallel>false</BuildInParallel> - </Projects2> + <Projects2 Include="python.vcxproj;pythonw.vcxproj" /> </ItemGroup> <Target Name="Build"> diff --git a/Python/importlib_external.h b/Python/importlib_external.h index 1b767c5..2f40978 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -2334,7 +2334,7 @@ const unsigned char _Py_M__importlib_external[] = { 111,111,116,115,116,114,97,112,32,109,111,100,117,108,101,46, 10,10,32,32,32,32,114,52,0,0,0,114,63,0,0,0, 218,8,98,117,105,108,116,105,110,115,114,140,0,0,0,90, - 5,112,111,115,105,120,250,1,47,218,2,110,116,250,1,92, + 5,112,111,115,105,120,250,1,47,90,2,110,116,250,1,92, 99,1,0,0,0,0,0,0,0,2,0,0,0,3,0,0, 0,115,0,0,0,115,26,0,0,0,124,0,93,18,125,1, 116,0,124,1,131,1,100,0,107,2,86,0,1,0,113,2, @@ -2376,61 +2376,58 @@ const unsigned char _Py_M__importlib_external[] = { 1,10,1,4,2,2,1,10,1,6,1,14,1,12,2,8, 1,12,1,12,1,18,3,2,1,14,1,16,2,10,1,12, 3,10,1,12,3,10,1,10,1,12,3,14,1,14,1,10, - 1,10,1,10,1,114,32,1,0,0,99,1,0,0,0,0, + 1,10,1,10,1,114,31,1,0,0,99,1,0,0,0,0, 0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115, - 72,0,0,0,116,0,124,0,131,1,1,0,116,1,131,0, + 50,0,0,0,116,0,124,0,131,1,1,0,116,1,131,0, 125,1,116,2,106,3,106,4,116,5,106,6,124,1,142,0, - 103,1,131,1,1,0,116,7,106,8,100,1,107,2,114,56, - 116,2,106,9,106,10,116,11,131,1,1,0,116,2,106,9, - 106,10,116,12,131,1,1,0,100,2,83,0,41,3,122,41, - 73,110,115,116,97,108,108,32,116,104,101,32,112,97,116,104, - 45,98,97,115,101,100,32,105,109,112,111,114,116,32,99,111, - 109,112,111,110,101,110,116,115,46,114,27,1,0,0,78,41, - 13,114,32,1,0,0,114,159,0,0,0,114,8,0,0,0, - 114,253,0,0,0,114,147,0,0,0,114,5,1,0,0,114, - 18,1,0,0,114,3,0,0,0,114,109,0,0,0,218,9, - 109,101,116,97,95,112,97,116,104,114,161,0,0,0,114,166, - 0,0,0,114,248,0,0,0,41,2,114,31,1,0,0,90, - 17,115,117,112,112,111,114,116,101,100,95,108,111,97,100,101, - 114,115,114,4,0,0,0,114,4,0,0,0,114,6,0,0, - 0,218,8,95,105,110,115,116,97,108,108,158,5,0,0,115, - 12,0,0,0,0,2,8,1,6,1,20,1,10,1,12,1, - 114,34,1,0,0,41,1,114,0,0,0,0,41,2,114,1, - 0,0,0,114,2,0,0,0,41,1,114,49,0,0,0,41, - 1,78,41,3,78,78,78,41,3,78,78,78,41,2,114,62, - 0,0,0,114,62,0,0,0,41,1,78,41,1,78,41,58, - 114,111,0,0,0,114,12,0,0,0,90,37,95,67,65,83, - 69,95,73,78,83,69,78,83,73,84,73,86,69,95,80,76, - 65,84,70,79,82,77,83,95,66,89,84,69,83,95,75,69, - 89,114,11,0,0,0,114,13,0,0,0,114,19,0,0,0, - 114,21,0,0,0,114,30,0,0,0,114,40,0,0,0,114, - 41,0,0,0,114,45,0,0,0,114,46,0,0,0,114,48, - 0,0,0,114,58,0,0,0,218,4,116,121,112,101,218,8, - 95,95,99,111,100,101,95,95,114,142,0,0,0,114,17,0, - 0,0,114,132,0,0,0,114,16,0,0,0,114,20,0,0, - 0,90,17,95,82,65,87,95,77,65,71,73,67,95,78,85, - 77,66,69,82,114,77,0,0,0,114,76,0,0,0,114,88, - 0,0,0,114,78,0,0,0,90,23,68,69,66,85,71,95, - 66,89,84,69,67,79,68,69,95,83,85,70,70,73,88,69, - 83,90,27,79,80,84,73,77,73,90,69,68,95,66,89,84, - 69,67,79,68,69,95,83,85,70,70,73,88,69,83,114,83, - 0,0,0,114,89,0,0,0,114,95,0,0,0,114,99,0, - 0,0,114,101,0,0,0,114,120,0,0,0,114,127,0,0, - 0,114,139,0,0,0,114,145,0,0,0,114,148,0,0,0, - 114,153,0,0,0,218,6,111,98,106,101,99,116,114,160,0, - 0,0,114,165,0,0,0,114,166,0,0,0,114,181,0,0, - 0,114,191,0,0,0,114,207,0,0,0,114,215,0,0,0, - 114,220,0,0,0,114,226,0,0,0,114,221,0,0,0,114, - 227,0,0,0,114,246,0,0,0,114,248,0,0,0,114,5, - 1,0,0,114,23,1,0,0,114,159,0,0,0,114,32,1, - 0,0,114,34,1,0,0,114,4,0,0,0,114,4,0,0, - 0,114,4,0,0,0,114,6,0,0,0,218,8,60,109,111, - 100,117,108,101,62,8,0,0,0,115,108,0,0,0,4,16, - 4,1,4,1,2,1,6,3,8,17,8,5,8,5,8,6, - 8,12,8,10,8,9,8,5,8,7,10,22,10,123,16,1, - 12,2,4,1,4,2,6,2,6,2,8,2,16,45,8,34, - 8,19,8,12,8,12,8,28,8,17,10,55,10,12,10,10, - 8,14,6,3,4,1,14,67,14,64,14,29,16,110,14,41, - 18,45,18,16,4,3,18,53,14,60,14,42,14,127,0,5, - 14,127,0,22,10,23,8,11,8,68, + 103,1,131,1,1,0,116,2,106,7,106,8,116,9,131,1, + 1,0,100,1,83,0,41,2,122,41,73,110,115,116,97,108, + 108,32,116,104,101,32,112,97,116,104,45,98,97,115,101,100, + 32,105,109,112,111,114,116,32,99,111,109,112,111,110,101,110, + 116,115,46,78,41,10,114,31,1,0,0,114,159,0,0,0, + 114,8,0,0,0,114,253,0,0,0,114,147,0,0,0,114, + 5,1,0,0,114,18,1,0,0,218,9,109,101,116,97,95, + 112,97,116,104,114,161,0,0,0,114,248,0,0,0,41,2, + 114,30,1,0,0,90,17,115,117,112,112,111,114,116,101,100, + 95,108,111,97,100,101,114,115,114,4,0,0,0,114,4,0, + 0,0,114,6,0,0,0,218,8,95,105,110,115,116,97,108, + 108,158,5,0,0,115,8,0,0,0,0,2,8,1,6,1, + 20,1,114,33,1,0,0,41,1,114,0,0,0,0,41,2, + 114,1,0,0,0,114,2,0,0,0,41,1,114,49,0,0, + 0,41,1,78,41,3,78,78,78,41,3,78,78,78,41,2, + 114,62,0,0,0,114,62,0,0,0,41,1,78,41,1,78, + 41,58,114,111,0,0,0,114,12,0,0,0,90,37,95,67, + 65,83,69,95,73,78,83,69,78,83,73,84,73,86,69,95, + 80,76,65,84,70,79,82,77,83,95,66,89,84,69,83,95, + 75,69,89,114,11,0,0,0,114,13,0,0,0,114,19,0, + 0,0,114,21,0,0,0,114,30,0,0,0,114,40,0,0, + 0,114,41,0,0,0,114,45,0,0,0,114,46,0,0,0, + 114,48,0,0,0,114,58,0,0,0,218,4,116,121,112,101, + 218,8,95,95,99,111,100,101,95,95,114,142,0,0,0,114, + 17,0,0,0,114,132,0,0,0,114,16,0,0,0,114,20, + 0,0,0,90,17,95,82,65,87,95,77,65,71,73,67,95, + 78,85,77,66,69,82,114,77,0,0,0,114,76,0,0,0, + 114,88,0,0,0,114,78,0,0,0,90,23,68,69,66,85, + 71,95,66,89,84,69,67,79,68,69,95,83,85,70,70,73, + 88,69,83,90,27,79,80,84,73,77,73,90,69,68,95,66, + 89,84,69,67,79,68,69,95,83,85,70,70,73,88,69,83, + 114,83,0,0,0,114,89,0,0,0,114,95,0,0,0,114, + 99,0,0,0,114,101,0,0,0,114,120,0,0,0,114,127, + 0,0,0,114,139,0,0,0,114,145,0,0,0,114,148,0, + 0,0,114,153,0,0,0,218,6,111,98,106,101,99,116,114, + 160,0,0,0,114,165,0,0,0,114,166,0,0,0,114,181, + 0,0,0,114,191,0,0,0,114,207,0,0,0,114,215,0, + 0,0,114,220,0,0,0,114,226,0,0,0,114,221,0,0, + 0,114,227,0,0,0,114,246,0,0,0,114,248,0,0,0, + 114,5,1,0,0,114,23,1,0,0,114,159,0,0,0,114, + 31,1,0,0,114,33,1,0,0,114,4,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,6,0,0,0,218,8,60, + 109,111,100,117,108,101,62,8,0,0,0,115,108,0,0,0, + 4,16,4,1,4,1,2,1,6,3,8,17,8,5,8,5, + 8,6,8,12,8,10,8,9,8,5,8,7,10,22,10,123, + 16,1,12,2,4,1,4,2,6,2,6,2,8,2,16,45, + 8,34,8,19,8,12,8,12,8,28,8,17,10,55,10,12, + 10,10,8,14,6,3,4,1,14,67,14,64,14,29,16,110, + 14,41,18,45,18,16,4,3,18,53,14,60,14,42,14,127, + 0,5,14,127,0,22,10,23,8,11,8,68, }; |