Skip to content

Commit 51a4872

Browse files
author
Jimmy Lai
committed
Merge branch 'master' of https://github.com/python/cpython into asyncio
* 'master' of https://github.com/python/cpython: (32 commits) Conceptually, roots is a set. Also searching it as a set is a tiny bit faster (python#3338) bpo-31343: Include sys/sysmacros.h (python#3318) bpo-30102: Call OPENSSL_add_all_algorithms_noconf (python#3112) Prevent a few make suspicious warnings. (python#3341) Include additional changes to support blurbified NEWS (python#3340) Simplify NEWS entry to prevent suspicious warnings. (python#3339) bpo-31347: _PyObject_FastCall_Prepend: do not call memcpy if args might not be null (python#3329) Revert "bpo-17852: Maintain a list of BufferedWriter objects. Flush them on exit. (python#1908)" (python#3337) bpo-17852: Maintain a list of BufferedWriter objects. Flush them on exit. (python#1908) Fix terminology in comment and add more design rationale. (python#3335) Add comment to explain the implications of not sorting keywords (python#3331) bpo-31170: Update libexpat from 2.2.3 to 2.2.4 (python#3315) bpo-28411: Remove "modules" field from Py_InterpreterState. (python#1638) random_triangular: sqrt() is more accurate than **0.5 (python#3317) Travis: use ccache (python#3307) remove IRIX support (closes bpo-31341) (python#3310) Code clean-up. Remove unnecessary pre-increment before the loop starts. (python#3312) Regen Moduls/clinic/_ssl.c.h (pythonGH-3320) bpo-30502: Fix handling of long oids in ssl. (python#2909) Cache externals, depending on changes to PCbuild (python#3308) ...
2 parents 923312f + 15ce0be commit 51a4872

587 files changed

Lines changed: 26872 additions & 10421 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.

‎.github/CODEOWNERS‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
Python/bootstrap_hash.c @python/crypto-team
2525

2626
# Email and related
27-
**/*mail* @bitdancer
28-
**/*smtp* @bitdancer
29-
**/*mime* @bitdancer
30-
**/*imap* @bitdancer
31-
**/*poplib* @bitdancer
27+
**/*mail* @python/email-team
28+
**/*smtp* @python/email-team
29+
**/*mime* @python/email-team
30+
**/*imap* @python/email-team
31+
**/*poplib* @python/email-team
3232

3333
# subprocess
3434
**/*subprocess* @gpshead
@@ -40,3 +40,12 @@ Python/bootstrap_hash.c @python/crypto-team
4040
# Windows installer packages
4141
/Tools/msi/ @python/windows-team
4242
/Tools/nuget/ @python/windows-team
43+
44+
**/*itertools* @rhettinger
45+
**/*collections* @rhettinger
46+
**/*random* @rhettinger
47+
**/*queue* @rhettinger
48+
**/*bisect* @rhettinger
49+
**/*heapq* @rhettinger
50+
**/*functools* @ncoghlan @rhettinger
51+
**/*decimal* @rhettinger @skrah

‎.github/appveyor.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ branches:
55
- master
66
- /\d\.\d/
77
- buildbot-custom
8+
cache:
9+
- externals -> PCbuild\*
810
build_script:
911
- cmd: PCbuild\build.bat -e
1012
- cmd: PCbuild\win32\python.exe -m test.pythoninfo

‎.travis.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ dist: trusty
33
sudo: false
44
group: beta
55

6-
# To cache doc-building dependencies.
7-
cache: pip
6+
# To cache doc-building dependencies and C compiler output.
7+
cache:
8+
- pip
9+
- ccache
810

911
branches:
1012
only:
@@ -41,7 +43,7 @@ matrix:
4143
- cd Doc
4244
# Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
4345
# (Updating the version is fine as long as no warnings are raised by doing so.)
44-
- python -m pip install sphinx~=1.6.1
46+
- python -m pip install sphinx~=1.6.1 blurb
4547
script:
4648
- make check suspicious html SPHINXOPTS="-q -W -j4"
4749
- os: linux

‎Doc/Makefile‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# You can set these variables from the command line.
77
PYTHON = python3
88
SPHINXBUILD = sphinx-build
9+
BLURB = $(PYTHON) -m blurb
910
PAPER =
1011
SOURCES =
1112
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
@@ -38,6 +39,20 @@ help:
3839
@echo " serve to serve the documentation on the localhost (8000)"
3940

4041
build:
42+
-mkdir -p build
43+
# Look first for a Misc/NEWS file (building from a source release tarball
44+
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
45+
# (building from a newer repo) and use blurb to generate the NEWS file.
46+
@if [ -f ../Misc/NEWS ] ; then \
47+
echo "Using existing Misc/NEWS file"; \
48+
cp ../Misc/NEWS build/NEWS; \
49+
elif [ -d ../Misc/NEWS.d ]; then \
50+
echo "Building NEWS from Misc/NEWS.d with blurb"; \
51+
$(BLURB) merge -f build/NEWS; \
52+
else \
53+
echo "Neither Misc/NEWS.d nor Misc/NEWS found; cannot build docs"; \
54+
exit 1; \
55+
fi
4156
$(SPHINXBUILD) $(ALLSPHINXOPTS)
4257
@echo
4358

@@ -107,7 +122,7 @@ clean:
107122

108123
venv:
109124
$(PYTHON) -m venv venv
110-
./venv/bin/python3 -m pip install -U Sphinx
125+
./venv/bin/python3 -m pip install -U Sphinx blurb
111126

112127
dist:
113128
rm -rf dist

‎Doc/c-api/import.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ Importing Modules
204204
Return the dictionary used for the module administration (a.k.a.
205205
``sys.modules``). Note that this is a per-interpreter variable.
206206
207+
.. c:function:: PyObject* PyImport_GetModule(PyObject *name)
208+
209+
Return the already imported module with the given name. If the
210+
module has not been imported yet then returns NULL but does not set
211+
an error. Returns NULL and sets an error if the lookup failed.
212+
213+
.. versionadded:: 3.7
207214
208215
.. c:function:: PyObject* PyImport_GetImporter(PyObject *path)
209216

‎Doc/distutils/apiref.rst‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,19 +1086,16 @@ other utility module.
10861086

10871087
Return a string that identifies the current platform. This is used mainly to
10881088
distinguish platform-specific build directories and platform-specific built
1089-
distributions. Typically includes the OS name and version and the architecture
1090-
(as supplied by 'os.uname()'), although the exact information included depends
1091-
on the OS; eg. for IRIX the architecture isn't particularly important (IRIX only
1092-
runs on SGI hardware), but for Linux the kernel version isn't particularly
1093-
important.
1089+
distributions. Typically includes the OS name and version and the
1090+
architecture (as supplied by 'os.uname()'), although the exact information
1091+
included depends on the OS; e.g., on Linux, the kernel version isn't
1092+
particularly important.
10941093

10951094
Examples of returned values:
10961095

10971096
* ``linux-i586``
10981097
* ``linux-alpha``
10991098
* ``solaris-2.6-sun4u``
1100-
* ``irix-5.3``
1101-
* ``irix64-6.2``
11021099

11031100
For non-POSIX platforms, currently just returns ``sys.platform``.
11041101

‎Doc/library/aifc.rst‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ AIFF is Audio Interchange File Format, a format for storing digital audio
1818
samples in a file. AIFF-C is a newer version of the format that includes the
1919
ability to compress the audio data.
2020

21-
.. note::
22-
23-
Some operations may only work under IRIX; these will raise :exc:`ImportError`
24-
when attempting to import the :mod:`cl` module, which is only available on
25-
IRIX.
26-
2721
Audio files have a number of parameters that describe the audio data. The
2822
sampling rate or frame rate is the number of times per second the sound is
2923
sampled. The number of channels indicate if the audio is mono, stereo, or

‎Doc/library/argparse.rst‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,8 @@ values are:
898898
usage: PROG [-h] foo [foo ...]
899899
PROG: error: too few arguments
900900

901+
.. _`argparse.REMAINDER`:
902+
901903
* ``argparse.REMAINDER``. All the remaining command-line arguments are gathered
902904
into a list. This is commonly useful for command line utilities that dispatch
903905
to other command line utilities::
@@ -1324,8 +1326,11 @@ The parse_args() method
13241326
created and how they are assigned. See the documentation for
13251327
:meth:`add_argument` for details.
13261328

1327-
By default, the argument strings are taken from :data:`sys.argv`, and a new empty
1328-
:class:`Namespace` object is created for the attributes.
1329+
* args_ - List of strings to parse. The default is taken from
1330+
:data:`sys.argv`.
1331+
1332+
* namespace_ - An object to take the attributes. The default is a new empty
1333+
:class:`Namespace` object.
13291334

13301335

13311336
Option value syntax
@@ -1467,6 +1472,7 @@ unambiguous (the prefix matches a unique option)::
14671472
An error is produced for arguments that could produce more than one options.
14681473
This feature can be disabled by setting :ref:`allow_abbrev` to ``False``.
14691474

1475+
.. _args:
14701476

14711477
Beyond ``sys.argv``
14721478
^^^^^^^^^^^^^^^^^^^
@@ -1488,6 +1494,7 @@ interactive prompt::
14881494
>>> parser.parse_args(['1', '2', '3', '4', '--sum'])
14891495
Namespace(accumulate=<built-in function sum>, integers=[1, 2, 3, 4])
14901496

1497+
.. _namespace:
14911498

14921499
The Namespace object
14931500
^^^^^^^^^^^^^^^^^^^^
@@ -2008,7 +2015,12 @@ A partial upgrade path from :mod:`optparse` to :mod:`argparse`:
20082015
* Replace ``(options, args) = parser.parse_args()`` with ``args =
20092016
parser.parse_args()`` and add additional :meth:`ArgumentParser.add_argument`
20102017
calls for the positional arguments. Keep in mind that what was previously
2011-
called ``options``, now in :mod:`argparse` context is called ``args``.
2018+
called ``options``, now in the :mod:`argparse` context is called ``args``.
2019+
2020+
* Replace :meth:`optparse.OptionParser.disable_interspersed_args`
2021+
by setting ``nargs`` of a positional argument to `argparse.REMAINDER`_, or
2022+
use :meth:`~ArgumentParser.parse_known_args` to collect unparsed argument
2023+
strings in a separate list.
20122024

20132025
* Replace callback actions and the ``callback_*`` keyword arguments with
20142026
``type`` or ``action`` arguments.

‎Doc/library/string.rst‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,21 @@ attributes:
754754
be set in the subclass's class namespace).
755755

756756
* *idpattern* -- This is the regular expression describing the pattern for
757-
non-braced placeholders (the braces will be added automatically as
758-
appropriate). The default value is the regular expression
759-
``[_a-z][_a-z0-9]*``.
757+
non-braced placeholders. The default value is the regular expression
758+
``[_a-z][_a-z0-9]*``. If this is given and *braceidpattern* is ``None``
759+
this pattern will also apply to braced placeholders.
760+
761+
.. versionchanged:: 3.7
762+
*braceidpattern* can be used to define separate patterns used inside and
763+
outside the braces.
764+
765+
* *braceidpattern* -- This is like *idpattern* but describes the pattern for
766+
braced placeholders. Defaults to ``None`` which means to fall back to
767+
*idpattern* (i.e. the same pattern is used both inside and outside braces).
768+
If given, this allows you to define different patterns for braced and
769+
unbraced placeholders.
770+
771+
.. versionadded:: 3.7
760772

761773
* *flags* -- The regular expression flags that will be applied when compiling
762774
the regular expression used for recognizing substitutions. The default value

‎Doc/library/sysconfig.rst‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,15 @@ Other functions
173173

174174
This is used mainly to distinguish platform-specific build directories and
175175
platform-specific built distributions. Typically includes the OS name and
176-
version and the architecture (as supplied by :func:`os.uname`), although the
177-
exact information included depends on the OS; e.g. for IRIX the architecture
178-
isn't particularly important (IRIX only runs on SGI hardware), but for Linux
179-
the kernel version isn't particularly important.
176+
version and the architecture (as supplied by 'os.uname()'), although the
177+
exact information included depends on the OS; e.g., on Linux, the kernel
178+
version isn't particularly important.
180179

181180
Examples of returned values:
182181

183182
- linux-i586
184183
- linux-alpha (?)
185184
- solaris-2.6-sun4u
186-
- irix-5.3
187-
- irix64-6.2
188185

189186
Windows will return one of:
190187

0 commit comments

Comments
 (0)