Skip to content

Commit 52ea6ff

Browse files
committed
Merge branch 'main' into issue-44733
2 parents a6495ff + fdcc46d commit 52ea6ff

File tree

388 files changed

+18523
-15245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

388 files changed

+18523
-15245
lines changed

.azure-pipelines/find-tools.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Locate a set of the tools used for builds
2+
3+
steps:
4+
- template: windows-release/find-sdk.yml
5+
parameters:
6+
toolname: 'signtool.exe'
7+
8+
- powershell: |
9+
$vcvarsall = (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
10+
-prerelease `
11+
-latest `
12+
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
13+
-find VC\Auxiliary\Build\vcvarsall.bat)
14+
Write-Host "Found vcvarsall at $vcvarsall"
15+
Write-Host "##vso[task.setVariable variable=vcvarsall]$vcvarsall"
16+
displayName: 'Find vcvarsall.bat'
17+
18+
- powershell: |
19+
$msbuild = (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
20+
-prerelease `
21+
-latest `
22+
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
23+
-find MSBuild\Current\Bin\msbuild.exe)
24+
Write-Host "Found MSBuild at $msbuild"
25+
Write-Host "##vso[task.setVariable variable=msbuild]$msbuild"
26+
displayName: 'Find MSBuild'

.azure-pipelines/libffi-build.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: $(SourceTag)_$(Date:yyyyMMdd)$(Rev:.rr)
2+
3+
variables:
4+
IntDir: '$(Build.BinariesDirectory)'
5+
OutDir: '$(Build.ArtifactStagingDirectory)'
6+
7+
# MUST BE SET AT QUEUE TIME
8+
# SigningCertificate: 'Python Software Foundation'
9+
# SourcesRepo: 'https://github.com/python/cpython-source-deps'
10+
# SourceTag: 'libffi-3.4.2'
11+
12+
jobs:
13+
- job: Build_LibFFI
14+
displayName: LibFFI
15+
pool:
16+
vmImage: windows-latest
17+
18+
workspace:
19+
clean: all
20+
21+
steps:
22+
- checkout: none
23+
24+
- template: ./find-tools.yml
25+
26+
- powershell: |
27+
mkdir -Force "$(IntDir)\script"
28+
iwr "https://github.com/python/cpython/raw/main/PCbuild/prepare_libffi.bat" `
29+
-outfile "$(IntDir)\script\prepare_libffi.bat"
30+
displayName: 'Download build script'
31+
32+
- powershell: |
33+
git clone $(SourcesRepo) -b $(SourceTag) --depth 1 -c core.autocrlf=false -c core.eol=lf .
34+
displayName: 'Check out LibFFI sources'
35+
36+
- script: 'prepare_libffi.bat --install-cygwin'
37+
workingDirectory: '$(IntDir)\script'
38+
displayName: 'Install Cygwin and build'
39+
env:
40+
VCVARSALL: '$(vcvarsall)'
41+
LIBFFI_SOURCE: '$(Build.SourcesDirectory)'
42+
LIBFFI_OUT: '$(OutDir)'
43+
44+
- powershell: |
45+
if ((gci *\*.dll).Count -lt 4) {
46+
Write-Error "Did not generate enough DLL files"
47+
}
48+
if ((gci *\Include\ffi.h).Count -lt 4) {
49+
Write-Error "Did not generate enough include files"
50+
}
51+
failOnStderr: true
52+
workingDirectory: '$(OutDir)'
53+
displayName: 'Verify files were created'
54+
55+
- publish: '$(OutDir)'
56+
artifact: 'unsigned'
57+
displayName: 'Publish unsigned build'
58+
59+
- job: Sign_LibFFI
60+
displayName: Sign LibFFI
61+
dependsOn: Build_LibFFI
62+
pool:
63+
name: 'Windows Release'
64+
65+
workspace:
66+
clean: all
67+
68+
steps:
69+
- checkout: none
70+
- download: current
71+
artifact: unsigned
72+
73+
- template: ./find-tools.yml
74+
75+
- powershell: |
76+
signtool sign /q /a `
77+
/n "Python Software Foundation" `
78+
/fd sha256 `
79+
/tr http://timestamp.digicert.com/ /td sha256 `
80+
/d "LibFFI for Python" `
81+
(gci "$(Pipeline.Workspace)\unsigned\*.dll" -r)
82+
displayName: 'Sign files'
83+
84+
- publish: '$(Pipeline.Workspace)\unsigned'
85+
artifact: 'libffi'
86+
displayName: 'Publish libffi'

.azure-pipelines/openssl-build.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: $(SourceTag)_$(Date:yyyyMMdd)$(Rev:.rr)
2+
3+
variables:
4+
IntDir: '$(Build.BinariesDirectory)'
5+
OutDir: '$(Build.ArtifactStagingDirectory)'
6+
7+
# MUST BE SET AT QUEUE TIME
8+
# SigningCertificate: 'Python Software Foundation'
9+
# SourcesRepo: 'https://github.com/python/cpython-source-deps'
10+
# SourceTag: 'openssl-1.1.1k'
11+
12+
jobs:
13+
- job: Build_SSL
14+
displayName: OpenSSL
15+
pool:
16+
name: 'Windows Release'
17+
#vmImage: windows-latest
18+
19+
strategy:
20+
matrix:
21+
win32:
22+
Platform: 'win32'
23+
VCPlatform: 'amd64_x86'
24+
OpenSSLPlatform: 'VC-WIN32 no-asm'
25+
amd64:
26+
Platform: 'amd64'
27+
VCPlatform: 'amd64'
28+
OpenSSLPlatform: 'VC-WIN64A-masm'
29+
arm32:
30+
Platform: 'arm32'
31+
VCPlatform: 'amd64_arm'
32+
OpenSSLPlatform: 'VC-WIN32-ARM'
33+
arm64:
34+
Platform: 'arm64'
35+
VCPlatform: 'amd64_arm64'
36+
OpenSSLPlatform: 'VC-WIN64-ARM'
37+
38+
workspace:
39+
clean: all
40+
41+
steps:
42+
- checkout: none
43+
44+
- template: ./find-tools.yml
45+
46+
- powershell: |
47+
git clone $(SourcesRepo) -b $(SourceTag) --depth 1 .
48+
displayName: 'Check out OpenSSL sources'
49+
50+
- powershell: |
51+
$f = gi ms\uplink.c
52+
$c1 = gc $f
53+
$c2 = $c1 -replace '\(\(h = GetModuleHandle\(NULL\)\) == NULL\)', '((h = GetModuleHandleA("_ssl.pyd")) == NULL) if ((h = GetModuleHandleA("_ssl_d.pyd")) == NULL) if ((h = GetModuleHandle(NULL)) == NULL /*patched*/)'
54+
if ($c2 -ne $c1) {
55+
$c2 | Out-File $f -Encoding ASCII
56+
} else {
57+
Write-Host '##warning Failed to patch uplink.c'
58+
}
59+
displayName: 'Apply uplink.c patch'
60+
61+
- script: |
62+
call "$(vcvarsall)" $(VCPlatform)
63+
perl "$(Build.SourcesDirectory)\Configure" $(OpenSSLPlatform)
64+
nmake
65+
workingDirectory: '$(IntDir)'
66+
displayName: 'Build OpenSSL'
67+
68+
- script: |
69+
call "$(vcvarsall)" $(VCPlatform)
70+
signtool sign /q /a /n "$(SigningCertificate)" /fd sha256 /tr http://timestamp.digicert.com/ /td sha256 /d "OpenSSL for Python" *.dll
71+
workingDirectory: '$(IntDir)'
72+
displayName: 'Sign OpenSSL Build'
73+
condition: and(succeeded(), variables['SigningCertificate'])
74+
75+
- task: CopyFiles@2
76+
displayName: 'Copy built libraries for upload'
77+
inputs:
78+
SourceFolder: '$(IntDir)'
79+
Contents: |
80+
lib*.dll
81+
lib*.pdb
82+
lib*.lib
83+
include\openssl\*.h
84+
TargetFolder: '$(OutDir)'
85+
86+
- task: CopyFiles@2
87+
displayName: 'Copy header files for upload'
88+
inputs:
89+
SourceFolder: '$(Build.SourcesDirectory)'
90+
Contents: |
91+
include\openssl\*
92+
TargetFolder: '$(OutDir)'
93+
94+
- task: CopyFiles@2
95+
displayName: 'Copy applink files for upload'
96+
inputs:
97+
SourceFolder: '$(Build.SourcesDirectory)\ms'
98+
Contents: applink.c
99+
TargetFolder: '$(OutDir)\include'
100+
101+
- task: CopyFiles@2
102+
displayName: 'Copy LICENSE for upload'
103+
inputs:
104+
SourceFolder: '$(Build.SourcesDirectory)'
105+
Contents: LICENSE
106+
TargetFolder: '$(OutDir)'
107+
108+
- publish: '$(OutDir)'
109+
artifact: '$(Platform)'
110+
displayName: 'Publishing $(Platform)'

.azure-pipelines/tcltk-build.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: tcl$(TkSourceTag)_$(Date:yyyyMMdd)$(Rev:.rr)
2+
3+
variables:
4+
IntDir: '$(Build.BinariesDirectory)\obj'
5+
ExternalsDir: '$(Build.BinariesDirectory)\externals'
6+
OutDir: '$(Build.ArtifactStagingDirectory)'
7+
Configuration: 'Release'
8+
9+
# MUST BE SET AT QUEUE TIME
10+
# SigningCertificate: 'Python Software Foundation'
11+
# SourcesRepo: 'https://github.com/python/cpython-source-deps'
12+
# TclSourceTag: 'tcl-core-8.6.12.0'
13+
# TkSourceTag: 'tk-8.6.12.0'
14+
# TixSourceTag: 'tix-8.4.3.6'
15+
16+
jobs:
17+
- job: Build_TclTk
18+
displayName: 'Tcl/Tk'
19+
pool:
20+
name: 'Windows Release'
21+
#vmImage: windows-latest
22+
23+
workspace:
24+
clean: all
25+
26+
steps:
27+
- template: ./find-tools.yml
28+
29+
- powershell: |
30+
git clone $(SourcesRepo) -b $(TclSourceTag) --depth 1 "$(ExternalsDir)\$(TclSourceTag)"
31+
displayName: 'Check out Tcl sources'
32+
33+
- powershell: |
34+
git clone $(SourcesRepo) -b $(TkSourceTag) --depth 1 "$(ExternalsDir)\$(TkSourceTag)"
35+
displayName: 'Check out Tk sources'
36+
37+
- powershell: |
38+
git clone $(SourcesRepo) -b $(TixSourceTag) --depth 1 "$(ExternalsDir)\$(TixSourceTag)"
39+
displayName: 'Check out Tix sources'
40+
41+
# This msbuild.rsp file will be used by the build to forcibly override these variables
42+
- powershell: |
43+
del -Force -EA 0 msbuild.rsp
44+
"/p:IntDir=$(IntDir)\" >> msbuild.rsp
45+
"/p:ExternalsDir=$(ExternalsDir)\" >> msbuild.rsp
46+
"/p:tclDir=$(ExternalsDir)\$(TclSourceTag)\" >> msbuild.rsp
47+
"/p:tkDir=$(ExternalsDir)\$(TkSourceTag)\" >> msbuild.rsp
48+
"/p:tixDir=$(ExternalsDir)\$(TixSourceTag)\" >> msbuild.rsp
49+
displayName: 'Generate msbuild.rsp'
50+
51+
- powershell: |
52+
& "$(msbuild)" PCbuild\tcl.vcxproj "@msbuild.rsp" /p:Platform=Win32 /p:tcltkDir="$(OutDir)\win32"
53+
& "$(msbuild)" PCbuild\tk.vcxproj "@msbuild.rsp" /p:Platform=Win32 /p:tcltkDir="$(OutDir)\win32"
54+
& "$(msbuild)" PCbuild\tix.vcxproj "@msbuild.rsp" /p:Platform=Win32 /p:tcltkDir="$(OutDir)\win32"
55+
displayName: 'Build for win32'
56+
57+
- powershell: |
58+
& "$(msbuild)" PCbuild\tcl.vcxproj "@msbuild.rsp" /p:Platform=x64 /p:tcltkDir="$(OutDir)\amd64"
59+
& "$(msbuild)" PCbuild\tk.vcxproj "@msbuild.rsp" /p:Platform=x64 /p:tcltkDir="$(OutDir)\amd64"
60+
& "$(msbuild)" PCbuild\tix.vcxproj "@msbuild.rsp" /p:Platform=x64 /p:tcltkDir="$(OutDir)\amd64"
61+
displayName: 'Build for amd64'
62+
63+
- publish: '$(OutDir)'
64+
artifact: 'tcltk'
65+
displayName: 'Publishing tcltk'

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Modules/clinic/*.h linguist-generated=true
4646
Objects/clinic/*.h linguist-generated=true
4747
PC/clinic/*.h linguist-generated=true
4848
Python/clinic/*.h linguist-generated=true
49+
Python/deepfreeze/*.c linguist-generated=true
4950
Python/frozen_modules/*.h linguist-generated=true
5051
Python/frozen_modules/MANIFEST linguist-generated=true
5152
Include/internal/pycore_ast.h linguist-generated=true

.github/CODEOWNERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ Lib/ast.py @isidentical
130130

131131
**/*typing* @gvanrossum @Fidget-Spinner
132132

133-
**/*asyncore @giampaolo
134-
**/*asynchat @giampaolo
135133
**/*ftplib @giampaolo
136134
**/*shutil @giampaolo
137135

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,24 @@ Lib/distutils/command/*.pdb
5959
Lib/lib2to3/*.pickle
6060
Lib/test/data/*
6161
!Lib/test/data/README
62+
/_bootstrap_python
6263
/Makefile
6364
/Makefile.pre
65+
Mac/Makefile
66+
Mac/PythonLauncher/Info.plist
67+
Mac/PythonLauncher/Makefile
68+
Mac/PythonLauncher/Python Launcher
69+
Mac/PythonLauncher/Python Launcher.app/*
70+
Mac/Resources/app/Info.plist
71+
Mac/Resources/framework/Info.plist
72+
Mac/pythonw
73+
/*.framework/
6474
Misc/python.pc
6575
Misc/python-embed.pc
6676
Misc/python-config.sh
6777
Modules/Setup.config
6878
Modules/Setup.local
79+
Modules/Setup.stdlib
6980
Modules/config.c
7081
Modules/ld_so_aix
7182
Programs/_freeze_module
@@ -106,6 +117,7 @@ Tools/unicode/data/
106117
/platform
107118
/profile-clean-stamp
108119
/profile-run-stamp
120+
/Python/deepfreeze/*.c
109121
/pybuilddir.txt
110122
/pyconfig.h
111123
/python-config

Doc/c-api/iter.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ There are two functions specifically for working with iterators.
99

1010
.. c:function:: int PyIter_Check(PyObject *o)
1111
12-
Return non-zero if the object *o* supports the iterator protocol, and ``0``
13-
otherwise. This function always succeeds.
12+
Return non-zero if the object *o* can be safely passed to
13+
:c:func:`PyIter_Next`, and ``0`` otherwise. This function always succeeds.
1414
1515
.. c:function:: int PyAIter_Check(PyObject *o)
1616
@@ -21,10 +21,11 @@ There are two functions specifically for working with iterators.
2121
2222
.. c:function:: PyObject* PyIter_Next(PyObject *o)
2323
24-
Return the next value from the iteration *o*. The object must be an iterator
25-
(it is up to the caller to check this). If there are no remaining values,
26-
returns ``NULL`` with no exception set. If an error occurs while retrieving
27-
the item, returns ``NULL`` and passes along the exception.
24+
Return the next value from the iterator *o*. The object must be an iterator
25+
according to :c:func:`PyIter_Check` (it is up to the caller to check this).
26+
If there are no remaining values, returns ``NULL`` with no exception set.
27+
If an error occurs while retrieving the item, returns ``NULL`` and passes
28+
along the exception.
2829
2930
To write a loop which iterates over an iterator, the C code should look
3031
something like this::

0 commit comments

Comments
 (0)