Skip to content

Commit adac2da

Browse files
authored
Merge branch 'master' into issue30245
2 parents 9ed5051 + cdb89cd commit adac2da

File tree

158 files changed

+4643
-3054
lines changed

Some content is hidden

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

158 files changed

+4643
-3054
lines changed

.bzrignore

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

.gitignore

Lines changed: 2 additions & 0 deletions
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
@@ -74,6 +75,7 @@ config.status.lineno
7475
core
7576
db_home
7677
.hg/
78+
.idea/
7779
ipch/
7880
libpython*.a
7981
libpython*.so*

.travis.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,19 @@ 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:
3017
- env:
3118
- TESTING=coverage
3219
include:
20+
- os: linux
21+
language: c
22+
compiler: clang
23+
# gcc also works, but to keep the # of concurrent builds down, we use one C
24+
# compiler here and the other to run the coverage build.
25+
env:
26+
- TESTING=cpython
3327
- os: linux
3428
language: python
3529
# Build the docs against a stable version of Python so code bugs don't hold up doc-related PRs.
@@ -42,7 +36,7 @@ matrix:
4236
# (Updating the version is fine as long as no warnings are raised by doing so.)
4337
- python -m pip install sphinx~=1.6.1
4438
script:
45-
- make check suspicious html SPHINXOPTS="-q -W"
39+
- make check suspicious html SPHINXOPTS="-q -W -j4"
4640
- os: linux
4741
language: c
4842
compiler: gcc

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/sys.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,53 @@ Operating System Utilities
2626
one of the strings ``'<stdin>'`` or ``'???'``.
2727
2828
29+
.. c:function:: void PyOS_BeforeFork()
30+
31+
Function to prepare some internal state before a process fork. This
32+
should be called before calling :c:func:`fork` or any similar function
33+
that clones the current process.
34+
Only available on systems where :c:func:`fork` is defined.
35+
36+
.. versionadded:: 3.7
37+
38+
39+
.. c:function:: void PyOS_AfterFork_Parent()
40+
41+
Function to update some internal state after a process fork. This
42+
should be called from the parent process after calling :c:func:`fork`
43+
or any similar function that clones the current process, regardless
44+
of whether process cloning was successful.
45+
Only available on systems where :c:func:`fork` is defined.
46+
47+
.. versionadded:: 3.7
48+
49+
50+
.. c:function:: void PyOS_AfterFork_Child()
51+
52+
Function to update internal interpreter state after a process fork.
53+
This must be called from the child process after calling :c:func:`fork`,
54+
or any similar function that clones the current process, if there is
55+
any chance the process will call back into the Python interpreter.
56+
Only available on systems where :c:func:`fork` is defined.
57+
58+
.. versionadded:: 3.7
59+
60+
.. seealso::
61+
:func:`os.register_at_fork` allows registering custom Python functions
62+
to be called by :c:func:`PyOS_BeforeFork()`,
63+
:c:func:`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`.
64+
65+
2966
.. c:function:: void PyOS_AfterFork()
3067
3168
Function to update some internal state after a process fork; this should be
3269
called in the new process if the Python interpreter will continue to be used.
3370
If a new executable is loaded into the new process, this function does not need
3471
to be called.
3572
73+
.. deprecated:: 3.7
74+
This function is superseded by :c:func:`PyOS_AfterFork_Child()`.
75+
3676
3777
.. c:function:: int PyOS_CheckStack()
3878

Doc/data/refcounts.dat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ PyDict_GetItem:PyObject*::0:0
216216
PyDict_GetItem:PyObject*:p:0:
217217
PyDict_GetItem:PyObject*:key:0:
218218

219+
PyDict_GetItemWithError:PyObject*::0:0
220+
PyDict_GetItemWithError:PyObject*:p:0:
221+
PyDict_GetItemWithError:PyObject*:key:0:
222+
219223
PyDict_GetItemString:PyObject*::0:
220224
PyDict_GetItemString:PyObject*:p:0:
221225
PyDict_GetItemString:const char*:key::

Doc/howto/logging-cookbook.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ Implementing structured logging
16831683
-------------------------------
16841684

16851685
Although most logging messages are intended for reading by humans, and thus not
1686-
readily machine-parseable, there might be cirumstances where you want to output
1686+
readily machine-parseable, there might be circumstances where you want to output
16871687
messages in a structured format which *is* capable of being parsed by a program
16881688
(without needing complex regular expressions to parse the log message). This is
16891689
straightforward to achieve using the logging package. There are a number of

Doc/library/cmd.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,10 @@ immediate playback::
266266
'Draw circle with given radius an options extent and steps: CIRCLE 50'
267267
circle(*parse(arg))
268268
def do_position(self, arg):
269-
'Print the current turle position: POSITION'
269+
'Print the current turtle position: POSITION'
270270
print('Current position is %d %d\n' % position())
271271
def do_heading(self, arg):
272-
'Print the current turle heading in degrees: HEADING'
272+
'Print the current turtle heading in degrees: HEADING'
273273
print('Current heading is %d\n' % (heading(),))
274274
def do_color(self, arg):
275275
'Set the color: COLOR BLUE'

Doc/library/csv.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,10 @@ Reader objects (:class:`DictReader` instances and objects returned by the
401401

402402
.. method:: csvreader.__next__()
403403

404-
Return the next row of the reader's iterable object as a list, parsed according
405-
to the current dialect. Usually you should call this as ``next(reader)``.
404+
Return the next row of the reader's iterable object as a list (if the object
405+
was returned from :func:`reader`) or a dict (if it is a :class:`DictReader`
406+
instance), parsed according to the current dialect. Usually you should call
407+
this as ``next(reader)``.
406408

407409

408410
Reader objects have the following public attributes:

0 commit comments

Comments
 (0)