Skip to content

Commit d2925e6

Browse files
Merge branch 'master' into randrange-index
2 parents 2e8cfda + 73607be commit d2925e6

File tree

791 files changed

+37477
-19607
lines changed

Some content is hidden

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

791 files changed

+37477
-19607
lines changed

.azure-pipelines/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
matrix:
105105
win32:
106106
arch: win32
107-
buildOpt:
107+
buildOpt: '-p Win32'
108108
testRunTitle: '$(Build.SourceBranchName)-win32'
109109
testRunPlatform: win32
110110
win64:

.azure-pipelines/docs-steps.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ steps:
1212
inputs:
1313
versionSpec: '>=3.6'
1414

15-
- script: python -m pip install sphinx==2.2.0 blurb python-docs-theme
15+
- script: python -m pip install sphinx==3.2.1 blurb python-docs-theme
1616
displayName: 'Install build dependencies'
1717

1818
- ${{ if ne(parameters.latex, 'true') }}:
19-
- script: make check suspicious html PYTHON=python
19+
- script: make check html PYTHON=python
2020
workingDirectory: '$(build.sourcesDirectory)/Doc'
2121
displayName: 'Build documentation'
2222

@@ -31,7 +31,7 @@ steps:
3131
- ${{ if eq(parameters.upload, 'true') }}:
3232
- task: PublishBuildArtifacts@1
3333
displayName: 'Publish docs'
34-
34+
3535
inputs:
3636
PathToPublish: '$(build.sourcesDirectory)/Doc/build'
3737
ArtifactName: docs

.azure-pipelines/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
matrix:
105105
win32:
106106
arch: win32
107-
buildOpt:
107+
buildOpt: '-p Win32'
108108
testRunTitle: '$(System.PullRequest.TargetBranch)-win32'
109109
testRunPlatform: win32
110110
win64:

.azure-pipelines/windows-release/stage-pack-msix.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,11 @@ jobs:
120120
artifactName: unsigned_msix
121121
downloadPath: $(Build.BinariesDirectory)
122122

123+
# MSIX must be signed and timestamped simultaneously
123124
- powershell: |
124125
$failed = $true
125126
foreach ($retry in 1..3) {
126-
signtool sign /a /n "$(SigningCertificate)" /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d "$(SigningDescription)" (gi *.msix)
127+
signtool sign /a /n "$(SigningCertificate)" /fd sha256 /tr http://timestamp.digicert.com/ /td sha256 /d "$(SigningDescription)" (gi *.msix)
127128
if ($?) {
128129
$failed = $false
129130
break

.azure-pipelines/windows-release/stage-pack-nuget.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
condition: and(succeeded(), eq(variables['DoNuget'], 'true'))
55

66
pool:
7-
vmImage: windows-2019
7+
name: 'Windows Release'
88

99
workspace:
1010
clean: all
@@ -36,6 +36,14 @@ jobs:
3636
nuget pack "$(Build.BinariesDirectory)\layout\python.nuspec" -OutputDirectory $(Build.ArtifactStagingDirectory) -NoPackageAnalysis -NonInteractive
3737
displayName: 'Create nuget package'
3838
39+
- powershell: |
40+
gci *.nupkg | %{
41+
nuget sign "$_" -CertificateSubjectName "$(SigningCertificate)" -Timestamper http://timestamp.digicert.com/ -Overwrite
42+
}
43+
displayName: 'Sign nuget package'
44+
workingDirectory: $(Build.ArtifactStagingDirectory)
45+
condition: and(succeeded(), variables['SigningCertificate'])
46+
3947
- task: PublishBuildArtifacts@1
4048
displayName: 'Publish Artifact: nuget'
4149
inputs:

.azure-pipelines/windows-release/stage-sign.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
$files = (gi ${{ parameters.Include }} -Exclude ${{ parameters.Exclude }})
5858
$failed = $true
5959
foreach ($retry in 1..10) {
60-
signtool timestamp /t http://timestamp.verisign.com/scripts/timestamp.dll $files
60+
signtool timestamp /tr http://timestamp.digicert.com/ /td sha256 $files
6161
if ($?) {
6262
$failed = $false
6363
break

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ updates:
77
labels:
88
- "skip issue"
99
- "skip news"
10+
target_branch:
11+
- "master"
12+
- "3.9"
13+
- "3.8"

.github/workflows/build.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,37 @@ jobs:
4747
# https://github.com/python/core-workflow/issues/373
4848
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
4949
fi
50+
51+
check_generated_files:
52+
name: 'Check if generated files are up to date'
53+
runs-on: ubuntu-latest
54+
needs: check_source
55+
if: needs.check_source.outputs.run_tests == 'true'
56+
steps:
57+
- uses: actions/checkout@v2
58+
- uses: actions/setup-python@v2
59+
- name: Install Dependencies
60+
run: sudo ./.github/workflows/posix-deps-apt.sh
61+
- name: Build CPython
62+
run: |
63+
# Build Python with the libpython dynamic library
64+
./configure --with-pydebug --enable-shared
65+
make -j4 regen-all
66+
- name: Check for changes
67+
run: |
68+
changes=$(git status --porcelain)
69+
# Check for changes in regenerated files
70+
if ! test -z "$changes"
71+
then
72+
echo "Generated files not up to date. Perhaps you forgot to run make regen-all ;)"
73+
echo "$changes"
74+
exit 1
75+
fi
76+
- name: Check exported libpython symbols
77+
run: make smelly
78+
- name: Check limited ABI symbols
79+
run: make check-limited-abi
80+
5081
build_win32:
5182
name: 'Windows (x86)'
5283
runs-on: windows-latest
@@ -59,7 +90,7 @@ jobs:
5990
- name: Display build info
6091
run: .\python.bat -m test.pythoninfo
6192
- name: Tests
62-
run: .\PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
93+
run: .\PCbuild\rt.bat -p Win32 -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
6394

6495
build_win_amd64:
6596
name: 'Windows (x64)'
@@ -73,7 +104,7 @@ jobs:
73104
- name: Display build info
74105
run: .\python.bat -m test.pythoninfo
75106
- name: Tests
76-
run: .\PCbuild\rt.bat -x64 -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
107+
run: .\PCbuild\rt.bat -p x64 -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
77108

78109
build_macos:
79110
name: 'macOS'
@@ -106,7 +137,7 @@ jobs:
106137
run: sudo ./.github/workflows/posix-deps-apt.sh
107138
- name: 'Restore OpenSSL build'
108139
id: cache-openssl
109-
uses: actions/[email protected].2
140+
uses: actions/[email protected].3
110141
with:
111142
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
112143
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: sudo ./.github/workflows/posix-deps-apt.sh
3333
- name: 'Restore OpenSSL build'
3434
id: cache-openssl
35-
uses: actions/[email protected].2
35+
uses: actions/[email protected].3
3636
with:
3737
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
3838
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}

.github/workflows/doc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ jobs:
3636
- name: 'Install build dependencies'
3737
run: make -C Doc/ PYTHON=../python venv
3838
- name: 'Build documentation'
39-
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" doctest suspicious html
39+
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" doctest html
4040
- name: 'Upload'
41-
uses: actions/[email protected].0
41+
uses: actions/[email protected].1
4242
with:
4343
name: doc-html
4444
path: Doc/build/html

.github/workflows/stale.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Mark stale pull requests
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
stale:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/stale@v3
14+
with:
15+
repo-token: ${{ secrets.GITHUB_TOKEN }}
16+
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'
17+
stale-pr-label: 'stale'
18+
days-before-stale: 30
19+
days-before-close: -1

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ matrix:
5353
- cd Doc
5454
- make venv PYTHON=python
5555
script:
56-
- make check suspicious html SPHINXOPTS="-q -W -j4"
56+
- make check html SPHINXOPTS="-q -W -j4"
5757
- name: "Documentation tests"
5858
os: linux
5959
language: c
@@ -192,6 +192,8 @@ script:
192192
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
193193
# Check that all symbols exported by libpython start with "Py" or "_Py"
194194
- make smelly
195+
# Check that all symbols in the limited abi are present
196+
- make check-limited-abi
195197
# `-r -w` implicitly provided through `make buildbottest`.
196198
- |
197199
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then

Doc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ dist:
202202

203203
check:
204204
$(PYTHON) tools/rstlint.py -i tools -i $(VENVDIR) -i README.rst
205+
$(PYTHON) tools/rstlint.py ../Misc/NEWS.d/next/
205206

206207
serve:
207208
$(PYTHON) ../Tools/scripts/serve.py build/html
@@ -215,12 +216,11 @@ serve:
215216

216217
# for development releases: always build
217218
autobuild-dev:
218-
make dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1 -A switchers=1'
219-
-make suspicious
219+
make dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
220220

221221
# for quick rebuilds (HTML only)
222222
autobuild-dev-html:
223-
make html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1 -A switchers=1'
223+
make html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
224224

225225
# for stable releases: only build if not in pre-release stage (alpha, beta)
226226
# release candidate downloads are okay, since the stable tree can be in that stage

Doc/c-api/arg.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ API Functions
482482
*min* and no more than *max*; *min* and *max* may be equal. Additional
483483
arguments must be passed to the function, each of which should be a pointer to a
484484
:c:type:`PyObject*` variable; these will be filled in with the values from
485-
*args*; they will contain borrowed references. The variables which correspond
485+
*args*; they will contain :term:`borrowed references <borrowed reference>`.
486+
The variables which correspond
486487
to optional parameters not given by *args* will not be filled in; these should
487488
be initialized by the caller. This function returns true on success and false if
488489
*args* is not a tuple or contains the wrong number of elements; an exception

Doc/c-api/exceptions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ For convenience, some of these functions will always return a
182182
.. c:function:: PyObject* PyErr_SetFromErrnoWithFilename(PyObject *type, const char *filename)
183183
184184
Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename
185-
is given as a C string. *filename* is decoded from the filesystem encoding
186-
(:func:`os.fsdecode`).
185+
is given as a C string. *filename* is decoded from the :term:`filesystem
186+
encoding and error handler`.
187187
188188
189189
.. c:function:: PyObject* PyErr_SetFromWindowsErr(int ierr)
@@ -266,7 +266,7 @@ For convenience, some of these functions will always return a
266266
.. c:function:: void PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset)
267267
268268
Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string
269-
decoded from the filesystem encoding (:func:`os.fsdecode`).
269+
decoded from the :term:`filesystem encoding and error handler`.
270270
271271
.. versionadded:: 3.2
272272
@@ -343,7 +343,7 @@ an error value).
343343
344344
Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and
345345
*module* are UTF-8 encoded strings, and *filename* is decoded from the
346-
filesystem encoding (:func:`os.fsdecode`).
346+
:term:`filesystem encoding and error handler`.
347347
348348
349349
.. c:function:: int PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, const char *format, ...)

Doc/c-api/init.rst

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
151151

152152
.. c:var:: int Py_LegacyWindowsFSEncodingFlag
153153
154-
If the flag is non-zero, use the ``mbcs`` encoding instead of the UTF-8
155-
encoding for the filesystem encoding.
154+
If the flag is non-zero, use the ``mbcs`` encoding with ``replace`` error
155+
handler, instead of the UTF-8 encoding with ``surrogatepass`` error handler,
156+
for the :term:`filesystem encoding and error handler`.
156157

157158
Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment
158159
variable is set to a non-empty string.
@@ -375,6 +376,12 @@ Process-wide parameters
375376
The returned string points into static storage; the caller should not modify its
376377
value.
377378

379+
This function should not be called before :c:func:`Py_Initialize`, otherwise
380+
it returns ``NULL``.
381+
382+
.. versionchanged:: 3.10
383+
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
384+
378385

379386
.. c:function:: wchar_t* Py_GetPrefix()
380387
@@ -388,6 +395,12 @@ Process-wide parameters
388395
script at build time. The value is available to Python code as ``sys.prefix``.
389396
It is only useful on Unix. See also the next function.
390397

398+
This function should not be called before :c:func:`Py_Initialize`, otherwise
399+
it returns ``NULL``.
400+
401+
.. versionchanged:: 3.10
402+
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
403+
391404

392405
.. c:function:: wchar_t* Py_GetExecPrefix()
393406
@@ -423,6 +436,12 @@ Process-wide parameters
423436
while having :file:`/usr/local/plat` be a different filesystem for each
424437
platform.
425438

439+
This function should not be called before :c:func:`Py_Initialize`, otherwise
440+
it returns ``NULL``.
441+
442+
.. versionchanged:: 3.10
443+
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
444+
426445

427446
.. c:function:: wchar_t* Py_GetProgramFullPath()
428447
@@ -436,6 +455,12 @@ Process-wide parameters
436455
static storage; the caller should not modify its value. The value is available
437456
to Python code as ``sys.executable``.
438457

458+
This function should not be called before :c:func:`Py_Initialize`, otherwise
459+
it returns ``NULL``.
460+
461+
.. versionchanged:: 3.10
462+
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
463+
439464

440465
.. c:function:: wchar_t* Py_GetPath()
441466
@@ -454,8 +479,14 @@ Process-wide parameters
454479
can be (and usually is) modified later to change the search path for loading
455480
modules.
456481

482+
This function should not be called before :c:func:`Py_Initialize`, otherwise
483+
it returns ``NULL``.
484+
457485
.. XXX should give the exact rules
458486
487+
.. versionchanged:: 3.10
488+
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
489+
459490

460491
.. c:function:: void Py_SetPath(const wchar_t *)
461492
@@ -637,6 +668,12 @@ Process-wide parameters
637668
:c:func:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME`
638669
environment variable if it is set.
639670
671+
This function should not be called before :c:func:`Py_Initialize`, otherwise
672+
it returns ``NULL``.
673+
674+
.. versionchanged:: 3.10
675+
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
676+
640677
641678
.. _threads:
642679
@@ -1076,7 +1113,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
10761113
10771114
Get the current frame of the Python thread state *tstate*.
10781115
1079-
Return a strong reference. Return ``NULL`` if no frame is currently
1116+
Return a :term:`strong reference`. Return ``NULL`` if no frame is currently
10801117
executing.
10811118
10821119
See also :c:func:`PyEval_GetFrame`.

0 commit comments

Comments
 (0)