Skip to content

Commit c63b947

Browse files
author
Anselm Kruis
committed
Merge branch 3.8 into 3.8-slp
2 parents 61156ad + 5cadd3f commit c63b947

File tree

145 files changed

+1368
-575
lines changed

Some content is hidden

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

145 files changed

+1368
-575
lines changed

.github/workflows/build.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Tests
2+
3+
on:
4+
#push:
5+
# branches:
6+
# - master
7+
# - 3.8
8+
# - 3.7
9+
# paths-ignore:
10+
# - 'Doc/**'
11+
# - 'Misc/**'
12+
pull_request:
13+
branches:
14+
- master
15+
- 3.8
16+
- 3.7
17+
paths-ignore:
18+
- 'Doc/**'
19+
- 'Misc/**'
20+
21+
jobs:
22+
build_win32:
23+
name: 'Windows (x86)'
24+
runs-on: windows-latest
25+
steps:
26+
- uses: actions/checkout@v1
27+
- name: Build CPython
28+
run: .\PCbuild\build.bat -e -p Win32
29+
- name: Display build info
30+
run: .\python.bat -m test.pythoninfo
31+
- name: Tests
32+
run: .\PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
33+
34+
build_win_amd64:
35+
name: 'Windows (x64)'
36+
runs-on: windows-latest
37+
steps:
38+
- uses: actions/checkout@v1
39+
- name: Build CPython
40+
run: .\PCbuild\build.bat -e -p x64
41+
- name: Display build info
42+
run: .\python.bat -m test.pythoninfo
43+
- name: Tests
44+
run: .\PCbuild\rt.bat -x64 -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
45+
46+
build_macos:
47+
name: 'macOS'
48+
runs-on: macos-latest
49+
steps:
50+
- uses: actions/checkout@v1
51+
- name: Configure CPython
52+
run: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-dev
53+
- name: Build CPython
54+
run: make -s -j4
55+
- name: Display build info
56+
run: make pythoninfo
57+
- name: Tests
58+
run: make buildbottest TESTOPTS="-j4 -uall,-cpu"
59+
60+
build_ubuntu:
61+
name: 'Ubuntu'
62+
runs-on: ubuntu-latest
63+
env:
64+
OPENSSL_VER: 1.1.1d
65+
steps:
66+
- uses: actions/checkout@v1
67+
- name: Install Dependencies
68+
run: sudo ./.github/workflows/posix-deps-apt.sh
69+
- name: 'Restore OpenSSL build'
70+
id: cache-openssl
71+
uses: actions/cache@v1
72+
with:
73+
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
74+
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
75+
- name: Install OpenSSL
76+
if: steps.cache-openssl.outputs.cache-hit != 'true'
77+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux
78+
- name: Configure CPython
79+
run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
80+
- name: Build CPython
81+
run: make -s -j4
82+
- name: Display build info
83+
run: make pythoninfo
84+
- name: Tests
85+
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"

.github/workflows/coverage.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 3.8
8+
- 3.7
9+
paths-ignore:
10+
- 'Doc/**'
11+
- 'Misc/**'
12+
#pull_request:
13+
# branches:
14+
# - master
15+
# - 3.8
16+
# - 3.7
17+
# paths-ignore:
18+
# - 'Doc/**'
19+
# - 'Misc/**'
20+
21+
jobs:
22+
coverage_ubuntu:
23+
name: 'Ubuntu (Coverage)'
24+
runs-on: ubuntu-latest
25+
env:
26+
OPENSSL_VER: 1.1.1d
27+
steps:
28+
- uses: actions/checkout@v1
29+
- name: Install Dependencies
30+
run: sudo ./.github/workflows/posix-deps-apt.sh
31+
- name: 'Restore OpenSSL build'
32+
id: cache-openssl
33+
uses: actions/cache@v1
34+
with:
35+
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
36+
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
37+
- name: Install OpenSSL
38+
if: steps.cache-openssl.outputs.cache-hit != 'true'
39+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux
40+
- name: Configure CPython
41+
run: ./configure --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
42+
- name: Build CPython
43+
run: make -s -j4
44+
- name: Display build info
45+
run: make pythoninfo
46+
- name: 'Coverage Preparation'
47+
run: |
48+
./python -m venv .venv
49+
source ./.venv/bin/activate
50+
python -m pip install -U coverage
51+
python -m test.pythoninfo
52+
- name: 'Tests with coverage'
53+
run: >
54+
source ./.venv/bin/activate &&
55+
xvfb-run python -m coverage
56+
run --branch --pylib
57+
-m test
58+
--fail-env-changed
59+
-uall,-cpu
60+
-x test_multiprocessing_fork
61+
-x test_multiprocessing_forkserver
62+
-x test_multiprocessing_spawn
63+
-x test_concurrent_futures
64+
|| true
65+
- name: 'Publish code coverage results'
66+
run: |
67+
source ./.venv/bin/activate
68+
bash <(curl -s https://codecov.io/bash)
69+
env:
70+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
71+
72+
c_coverage_ubuntu:
73+
name: 'Ubuntu (C Coverage)'
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@v1
77+
- name: Install Dependencies
78+
run: sudo ./.github/workflows/posix-deps-apt.sh
79+
- name: Configure CPython
80+
run: ./configure
81+
- name: 'Build CPython and measure coverage'
82+
run: xvfb-run make -j4 coverage-report
83+
- name: 'Publish code coverage results'
84+
if: always()
85+
run: |
86+
make pythoninfo
87+
bash <(curl -s https://codecov.io/bash)
88+
env:
89+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/doc.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Docs
2+
3+
on:
4+
#push:
5+
# branches:
6+
# - master
7+
# - 3.8
8+
# - 3.7
9+
# paths:
10+
# - 'Doc/**'
11+
pull_request:
12+
branches:
13+
- master
14+
- 3.8
15+
- 3.7
16+
paths:
17+
- 'Doc/**'
18+
- 'Misc/**'
19+
20+
jobs:
21+
build_doc:
22+
name: 'Docs'
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v1
26+
- uses: actions/setup-python@v1
27+
with:
28+
python-version: '3.7'
29+
architecture: 'x64'
30+
- name: 'Install build dependencies'
31+
run: python -m pip install sphinx==2.2.0 blurb python-docs-theme
32+
- name: 'Build documentation'
33+
run: |
34+
cd Doc
35+
make check suspicious html PYTHON=python
36+
- name: Upload
37+
uses: actions/upload-artifact@v1
38+
with:
39+
name: doc-html
40+
path: Doc/build/html

.github/workflows/posix-deps-apt.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
apt-get update
3+
4+
apt-get -yq install \
5+
build-essential \
6+
zlib1g-dev \
7+
libbz2-dev \
8+
liblzma-dev \
9+
libncurses5-dev \
10+
libreadline6-dev \
11+
libsqlite3-dev \
12+
libssl-dev \
13+
libgdbm-dev \
14+
tk-dev \
15+
lzma \
16+
lzma-dev \
17+
liblzma-dev \
18+
libffi-dev \
19+
uuid-dev \
20+
xvfb \
21+
lcov

Doc/c-api/code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bound into a function.
4242
4343
.. c:function:: PyCodeObject* PyCode_NewWithPosOnlyArgs(int argcount, int posonlyargcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, int firstlineno, PyObject *lnotab)
4444
45-
Similar to :c:func:`PyCode_New`, but with an extra "posonlyargcount" for positonal-only arguments.
45+
Similar to :c:func:`PyCode_New`, but with an extra "posonlyargcount" for positional-only arguments.
4646
4747
.. versionadded:: 3.8
4848

Doc/c-api/init.rst

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ It is usually the only Python interpreter in a process. Unlike sub-interpreters
11811181
the main interpreter has unique process-global responsibilities like signal
11821182
handling. It is also responsible for execution during runtime initialization and
11831183
is usually the active interpreter during runtime finalization. The
1184-
:c:func:`PyInterpreterState_Main` funtion returns a pointer to its state.
1184+
:c:func:`PyInterpreterState_Main` function returns a pointer to its state.
11851185
11861186
You can switch between sub-interpreters using the :c:func:`PyThreadState_Swap`
11871187
function. You can create and destroy them using the following functions:
@@ -1222,15 +1222,31 @@ function. You can create and destroy them using the following functions:
12221222
single: Py_FinalizeEx()
12231223
single: Py_Initialize()
12241224
1225-
Extension modules are shared between (sub-)interpreters as follows: the first
1226-
time a particular extension is imported, it is initialized normally, and a
1227-
(shallow) copy of its module's dictionary is squirreled away. When the same
1228-
extension is imported by another (sub-)interpreter, a new module is initialized
1229-
and filled with the contents of this copy; the extension's ``init`` function is
1230-
not called. Note that this is different from what happens when an extension is
1231-
imported after the interpreter has been completely re-initialized by calling
1232-
:c:func:`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, the extension's
1233-
``initmodule`` function *is* called again.
1225+
Extension modules are shared between (sub-)interpreters as follows:
1226+
1227+
* For modules using multi-phase initialization,
1228+
e.g. :c:func:`PyModule_FromDefAndSpec`, a separate module object is
1229+
created and initialized for each interpreter.
1230+
Only C-level static and global variables are shared between these
1231+
module objects.
1232+
1233+
* For modules using single-phase initialization,
1234+
e.g. :c:func:`PyModule_Create`, the first time a particular extension
1235+
is imported, it is initialized normally, and a (shallow) copy of its
1236+
module's dictionary is squirreled away.
1237+
When the same extension is imported by another (sub-)interpreter, a new
1238+
module is initialized and filled with the contents of this copy; the
1239+
extension's ``init`` function is not called.
1240+
Objects in the module's dictionary thus end up shared across
1241+
(sub-)interpreters, which might cause unwanted behavior (see
1242+
`Bugs and caveats`_ below).
1243+
1244+
Note that this is different from what happens when an extension is
1245+
imported after the interpreter has been completely re-initialized by
1246+
calling :c:func:`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that
1247+
case, the extension's ``initmodule`` function *is* called again.
1248+
As with multi-phase initialization, this means that only C-level static
1249+
and global variables are shared between these modules.
12341250
12351251
.. index:: single: close() (in module os)
12361252
@@ -1256,14 +1272,16 @@ process, the insulation between them isn't perfect --- for example, using
12561272
low-level file operations like :func:`os.close` they can
12571273
(accidentally or maliciously) affect each other's open files. Because of the
12581274
way extensions are shared between (sub-)interpreters, some extensions may not
1259-
work properly; this is especially likely when the extension makes use of
1260-
(static) global variables, or when the extension manipulates its module's
1261-
dictionary after its initialization. It is possible to insert objects created
1262-
in one sub-interpreter into a namespace of another sub-interpreter; this should
1263-
be done with great care to avoid sharing user-defined functions, methods,
1264-
instances or classes between sub-interpreters, since import operations executed
1265-
by such objects may affect the wrong (sub-)interpreter's dictionary of loaded
1266-
modules.
1275+
work properly; this is especially likely when using single-phase initialization
1276+
or (static) global variables.
1277+
It is possible to insert objects created in one sub-interpreter into
1278+
a namespace of another (sub-)interpreter; this should be avoided if possible.
1279+
1280+
Special care should be taken to avoid sharing user-defined functions,
1281+
methods, instances or classes between sub-interpreters, since import
1282+
operations executed by such objects may affect the wrong (sub-)interpreter's
1283+
dictionary of loaded modules. It is equally important to avoid sharing
1284+
objects from which the above are reachable.
12671285
12681286
Also note that combining this functionality with :c:func:`PyGILState_\*` APIs
12691287
is delicate, because these APIs assume a bijection between Python thread states

Doc/c-api/init_config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ configuration, and then override some parameters::
757757
PyConfig config;
758758
PyConfig_InitPythonConfig(&config);
759759
760-
/* Set the program name before reading the configuraton
760+
/* Set the program name before reading the configuration
761761
(decode byte string from the locale encoding).
762762
763763
Implicitly preinitialize Python. */

Doc/c-api/iter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ something like this::
2929
/* propagate error */
3030
}
3131
32-
while (item = PyIter_Next(iterator)) {
32+
while ((item = PyIter_Next(iterator))) {
3333
/* do something with item */
3434
...
3535
/* release reference when done */

Doc/copyright.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright
44

55
Python and this documentation is:
66

7-
Copyright © 2001-2019 Python Software Foundation. All rights reserved.
7+
Copyright © 2001-2020 Python Software Foundation. All rights reserved.
88

99
Copyright © 2000 BeOpen.com. All rights reserved.
1010

Doc/faq/programming.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ That's a tough one, in general. First, here are a list of things to
10191019
remember before diving further:
10201020

10211021
* Performance characteristics vary across Python implementations. This FAQ
1022-
focusses on :term:`CPython`.
1022+
focuses on :term:`CPython`.
10231023
* Behaviour can vary across operating systems, especially when talking about
10241024
I/O or multi-threading.
10251025
* You should always find the hot spots in your program *before* attempting to

0 commit comments

Comments
 (0)