Skip to content

Commit 67e39a5

Browse files
committed
pull from upstream
2 parents bcc9cce + e8eb17b commit 67e39a5

666 files changed

Lines changed: 58030 additions & 48788 deletions

File tree

Some content is hidden

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

.bzrignore

Lines changed: 0 additions & 42 deletions
This file was deleted.

.gitattributes

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,41 @@
1+
# Binary data types
2+
*.aif binary
3+
*.aifc binary
4+
*.aiff binary
5+
*.au binary
6+
*.bmp binary
7+
*.exe binary
8+
*.icns binary
9+
*.gif binary
10+
*.ico binary
11+
*.jpg binary
112
*.pck binary
2-
Lib/test/cjkencodings/* binary
3-
Lib/test/decimaltestdata/*.decTest binary
13+
*.png binary
14+
*.psd binary
15+
*.tar binary
16+
*.wav binary
17+
*.whl binary
18+
*.zip binary
19+
20+
# Specific binary files
421
Lib/test/sndhdrdata/sndhdr.* binary
5-
Lib/test/test_email/data/msg_26.txt binary
6-
Lib/test/xmltestdata/* binary
7-
Lib/venv/scripts/nt/* binary
8-
Lib/test/coding20731.py binary
22+
23+
# Text files that should not be subject to eol conversion
24+
Lib/test/cjkencodings/* -text
25+
Lib/test/decimaltestdata/*.decTest -text
26+
Lib/test/test_email/data/*.txt -text
27+
Lib/test/xmltestdata/* -text
28+
Lib/test/coding20731.py -text
29+
30+
# Special files in third party code
31+
Modules/zlib/zlib.map -text
32+
33+
# CRLF files
34+
*.bat text eol=crlf
35+
*.ps1 text eol=crlf
36+
*.sln text eol=crlf
37+
*.vcxproj* text eol=crlf
38+
*.props text eol=crlf
39+
*.proj text eol=crlf
40+
PCbuild/readme.txt text eol=crlf
41+
PC/readme.txt text eol=crlf

.github/appveyor.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
version: 3.7.0a0.{build}
22
clone_depth: 5
3+
branches:
4+
only:
5+
- master
6+
- /\d\.\d/
7+
- buildbot-custom
38
build_script:
49
- cmd: PCbuild\build.bat -e
510
test_script:
6-
- cmd: PCbuild\rt.bat -q -uall -rwW --slowest --timeout=1200 -j0
11+
- cmd: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 --fail-env-changed -j0
12+
environment:
13+
HOST_PYTHON: C:\Python36\python.exe
714

815
# Only trigger AppVeyor if actual code or its configuration changes
916
only_commits:

.github/codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
codecov:
2+
strict_yaml_branch: master
23
notify:
34
require_ci_to_pass: true
45
comment: off

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/python
44
!/Python/
55
*.cover
6+
*.iml
67
*.o
78
*.orig
89
*.pyc
@@ -59,7 +60,7 @@ PCbuild/*.VC.opendb
5960
PCbuild/.vs/
6061
PCbuild/amd64/
6162
PCbuild/obj/
62-
PCBuild/win32/
63+
PCbuild/win32/
6364
.purify
6465
Parser/pgen
6566
Parser/pgen.exe
@@ -75,6 +76,7 @@ core
7576
cscope*
7677
db_home
7778
.hg/
79+
.idea/
7880
ipch/
7981
libpython*.a
8082
libpython*.so*

.travis.yml

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,46 @@ branches:
1111
- master
1212
- /^\d\.\d$/
1313

14-
os:
15-
- linux
16-
# macOS builds are disabled as the machines are under-provisioned on Travis,
17-
# adding up to an extra hour completing a full CI run.
18-
19-
compiler:
20-
- clang
21-
# gcc also works, but to keep the # of concurrent builds down, we use one C
22-
# compiler here and the other to run the coverage build.
23-
24-
env:
25-
- TESTING=cpython
26-
2714
matrix:
2815
fast_finish: true
2916
allow_failures:
30-
- env:
31-
- TESTING=coverage
17+
- env: OPTIONAL=true
3218
include:
19+
- os: linux
20+
language: c
21+
compiler: clang
22+
# gcc also works, but to keep the # of concurrent builds down, we use one C
23+
# compiler here and the other to run the coverage build. Clang is preferred
24+
# in this instance for its better error messages.
25+
env: TESTING=cpython
26+
- os: osx
27+
language: c
28+
compiler: clang
29+
# Testing under macOS is optional until testing stability has been demonstrated.
30+
env: OPTIONAL=true
31+
before_install:
32+
- brew install openssl xz
33+
- export CPPFLAGS="-I$(brew --prefix openssl)/include"
34+
- export LDFLAGS="-L$(brew --prefix openssl)/lib"
3335
- os: linux
3436
language: python
3537
# Build the docs against a stable version of Python so code bugs don't hold up doc-related PRs.
3638
python: 3.6
37-
env:
38-
- TESTING=docs
39+
env: TESTING=docs
3940
before_script:
4041
- cd Doc
4142
# Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
4243
# (Updating the version is fine as long as no warnings are raised by doing so.)
4344
- python -m pip install sphinx~=1.6.1
4445
script:
45-
- make check suspicious html SPHINXOPTS="-q -W"
46+
- make check suspicious html SPHINXOPTS="-q -W -j4"
4647
- os: linux
4748
language: c
4849
compiler: gcc
49-
env:
50-
- TESTING=coverage
50+
env: OPTIONAL=true
5151
before_script:
5252
- |
53-
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(rst|yml)$)|(^Doc)|(^Misc)/'
53+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
5454
then
5555
echo "Only docs were updated, stopping build process."
5656
exit
@@ -62,26 +62,40 @@ matrix:
6262
./venv/bin/python -m pip install -U coverage
6363
script:
6464
# Skip tests that re-run the entire test suite.
65-
- ./venv/bin/python -m coverage run --pylib -m test -uall -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn
65+
- ./venv/bin/python -m coverage run --pylib -m test -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn
6666
after_script: # Probably should be after_success once test suite updated to run under coverage.py.
6767
# Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
6868
- source ./venv/bin/activate
6969
- bash <(curl -s https://codecov.io/bash)
7070

71-
# Travis provides only 2 cores, so don't overdue the parallelism and waste memory.
71+
# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
7272
before_script:
7373
- |
74-
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(rst|yml)$)|(^Doc)|(^Misc)/'
74+
set -e
75+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
7576
then
7677
echo "Only docs were updated, stopping build process."
7778
exit
7879
fi
7980
./configure --with-pydebug
8081
make -j4
82+
make -j4 regen-all clinic
83+
changes=`git status --porcelain`
84+
if ! test -z "$changes"
85+
then
86+
echo "Generated files not up to date"
87+
echo "$changes"
88+
exit 1
89+
fi
8190
8291
script:
92+
# Using the built Python as patchcheck.py is built around the idea of using
93+
# a checkout-build of CPython to know things like what base branch the changes
94+
# should be compared against.
95+
# Only run on Linux as the check only needs to be run once.
96+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
8397
# `-r -w` implicitly provided through `make buildbottest`.
84-
- make buildbottest TESTOPTS="-j4"
98+
- make buildbottest TESTOPTS="-j4 -uall,-cpu"
8599

86100
notifications:
87101
email: false

Doc/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,20 @@ serve:
159159
../Tools/scripts/serve.py build/html
160160

161161
# Targets for daily automated doc build
162+
# By default, Sphinx only rebuilds pages where the page content has changed.
163+
# This means it doesn't always pick up changes to preferred link targets, etc
164+
# To ensure such changes are picked up, we build the published docs with
165+
# `-E` (to ignore the cached environment) and `-a` (to ignore already existing
166+
# output files)
162167

163168
# for development releases: always build
164169
autobuild-dev:
165-
make dist SPHINXOPTS='$(SPHINXOPTS) -A daily=1 -A versionswitcher=1'
170+
make dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1 -A versionswitcher=1'
166171
-make suspicious
167172

168173
# for quick rebuilds (HTML only)
169174
autobuild-dev-html:
170-
make html SPHINXOPTS='$(SPHINXOPTS) -A daily=1 -A versionswitcher=1'
175+
make html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1 -A versionswitcher=1'
171176

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

Doc/c-api/exceptions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ an error value).
295295
:c:data:`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`;
296296
the default warning category is :c:data:`PyExc_RuntimeWarning`. The standard
297297
Python warning categories are available as global variables whose names are
298-
enumerated at :ref:`standarwarningcategories`.
298+
enumerated at :ref:`standardwarningcategories`.
299299
300300
For information about warning control, see the documentation for the
301301
:mod:`warnings` module and the :option:`-W` option in the command line
@@ -958,7 +958,7 @@ Notes:
958958
Only defined on Windows; protect code that uses this by testing that the
959959
preprocessor macro ``MS_WINDOWS`` is defined.
960960
961-
.. _standarwarningcategories:
961+
.. _standardwarningcategories:
962962
963963
Standard Warning Categories
964964
===========================
@@ -971,7 +971,7 @@ the variables:
971971
.. index::
972972
single: PyExc_Warning
973973
single: PyExc_BytesWarning
974-
single: PyExc_DepricationWarning
974+
single: PyExc_DeprecationWarning
975975
single: PyExc_FutureWarning
976976
single: PyExc_ImportWarning
977977
single: PyExc_PendingDeprecationWarning
@@ -994,7 +994,7 @@ the variables:
994994
+------------------------------------------+---------------------------------+----------+
995995
| :c:data:`PyExc_ImportWarning` | :exc:`ImportWarning` | |
996996
+------------------------------------------+---------------------------------+----------+
997-
| :c:data:`PyExc_PendingDepricationWarning`| :exc:`PendingDeprecationWarning`| |
997+
| :c:data:`PyExc_PendingDeprecationWarning`| :exc:`PendingDeprecationWarning`| |
998998
+------------------------------------------+---------------------------------+----------+
999999
| :c:data:`PyExc_ResourceWarning` | :exc:`ResourceWarning` | |
10001000
+------------------------------------------+---------------------------------+----------+

Doc/c-api/init.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ Additionally, when extending or embedding Python, calling :c:func:`fork`
564564
directly rather than through :func:`os.fork` (and returning to or calling
565565
into Python) may result in a deadlock by one of Python's internal locks
566566
being held by a thread that is defunct after the fork.
567-
:c:func:`PyOS_AfterFork` tries to reset the necessary locks, but is not
567+
:c:func:`PyOS_AfterFork_Child` tries to reset the necessary locks, but is not
568568
always able to.
569569

570570

@@ -675,9 +675,9 @@ code, or when embedding the Python interpreter:
675675
676676
.. c:function:: void PyEval_ReInitThreads()
677677
678-
This function is called from :c:func:`PyOS_AfterFork` to ensure that newly
679-
created child processes don't hold locks referring to threads which
680-
are not running in the child process.
678+
This function is called from :c:func:`PyOS_AfterFork_Child` to ensure
679+
that newly created child processes don't hold locks referring to threads
680+
which are not running in the child process.
681681
682682
683683
The following functions use thread-local storage, and are not compatible
@@ -821,6 +821,14 @@ been created.
821821
:c:func:`PyThreadState_Clear`.
822822
823823
824+
.. c:function:: PY_INT64_T PyInterpreterState_GetID(PyInterpreterState *interp)
825+
826+
Return the interpreter's unique ID. If there was any error in doing
827+
so then -1 is returned and an error is set.
828+
829+
.. versionadded:: 3.7
830+
831+
824832
.. c:function:: PyObject* PyThreadState_GetDict()
825833
826834
Return a dictionary in which extensions can store thread-specific state

Doc/c-api/memory.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,28 @@ Customize pymalloc Arena Allocator
429429
Set the arena allocator.
430430
431431
432+
tracemalloc C API
433+
=================
434+
435+
.. versionadded:: 3.7
436+
437+
.. c:function: int PyTraceMalloc_Track(unsigned int domain, uintptr_t ptr, size_t size)
438+
439+
Track an allocated memory block in the :mod:`tracemalloc` module.
440+
441+
Return 0 on success, return ``-1`` on error (failed to allocate memory to
442+
store the trace). Return ``-2`` if tracemalloc is disabled.
443+
444+
If memory block is already tracked, update the existing trace.
445+
446+
.. c:function: int PyTraceMalloc_Untrack(unsigned int domain, uintptr_t ptr)
447+
448+
Untrack an allocated memory block in the :mod:`tracemalloc` module.
449+
Do nothing if the block was not tracked.
450+
451+
Return ``-2`` if tracemalloc is disabled, otherwise return ``0``.
452+
453+
432454
.. _memoryexamples:
433455
434456
Examples

0 commit comments

Comments
 (0)