Skip to content

Commit bb8de0d

Browse files
Merge branch 'master' into asynccontextmanager
2 parents 06697a8 + 9dc2b38 commit bb8de0d

498 files changed

Lines changed: 10912 additions & 6391 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/CONTRIBUTING.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ everything from how to build the code to submitting a pull request. There are
2929
also suggestions on how you can most effectively help the project.
3030

3131
Please be aware that our workflow does deviate slightly from the typical GitHub
32-
project. Issues are tracked at https://bugs.python.org/ and should be mentioned
33-
in pull requests using the format of ``bpo-12345`` . If your pull request is in
34-
response to a specific issue then please mention it in the title,
35-
e.g. “bpo-12345: fix comment in tokenizer.c”.
32+
project. Details on how to properly submit a pull request are covered in
33+
`Lifecycle of a Pull Request <https://cpython-devguide.readthedocs.io/pullrequest.html>`_.
3634

3735
If you are making a code contribution or large documentation contribution,
3836
please feel free to add yourself to the ``Misc/ACKS`` file alphabetically.

.github/appveyor.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,20 @@ build_script:
44
- cmd: PCbuild\build.bat -e
55
test_script:
66
- cmd: PCbuild\rt.bat -q -uall -rwW --slowest --timeout=1200 -j0
7+
8+
# Only trigger AppVeyor if actual code or its configuration changes
9+
only_commits:
10+
files:
11+
- .github/appveyor.yml
12+
- .gitattributes
13+
- Grammar/
14+
- Include/
15+
- Lib/
16+
- Modules/
17+
- Objects/
18+
- PC/
19+
- PCBuild/
20+
- Parser/
21+
- Programs/
22+
- Python/
23+
- Tools/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
.gdb_history
1919
Doc/build/
2020
Doc/venv/
21+
Include/pydtrace_probes.h
2122
Lib/distutils/command/*.pdb
2223
Lib/lib2to3/*.pickle
2324
Lib/test/data/*
@@ -53,6 +54,8 @@ PCbuild/*.suo
5354
PCbuild/*.*sdf
5455
PCbuild/*-pgi
5556
PCbuild/*-pgo
57+
PCbuild/*.VC.db
58+
PCbuild/*.VC.opendb
5659
PCbuild/.vs/
5760
PCbuild/amd64/
5861
PCbuild/obj/

.mention-bot

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"maxReviewers": 5,
32
"numFilesToCheck": 10,
43
"findPotentialReviewers": true,
54
"fileBlacklist": [
@@ -8,5 +7,5 @@
87
"Doc/whatsnew/*.rst"
98
],
109
"userBlacklist": ["gvanrossum", "skrah", "haypo"],
11-
"userBlacklistForPR": ["benjaminp", "skrah"]
10+
"userBlacklistForPR": ["benjaminp", "skrah", "berkerpeksag"]
1211
}

.travis.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ os:
1515
- linux
1616
# macOS builds are disabled as the machines are under-provisioned on Travis,
1717
# adding up to an extra hour completing a full CI run.
18-
#- osx
1918

2019
compiler:
2120
- clang
22-
- gcc
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.
2323

2424
env:
2525
- TESTING=cpython
@@ -32,22 +32,22 @@ matrix:
3232
include:
3333
- os: linux
3434
language: python
35-
python: 3.5
35+
python: 3.6
3636
env:
3737
- TESTING=docs
3838
before_script:
3939
- cd Doc
4040
- make venv
4141
script:
42-
- make check suspicious html PYTHON="./venv/bin/python" SPHINXBUILD="./venv/bin/python -m sphinx" SPHINXOPTS="-q"
42+
- make check suspicious html PYTHON="./venv/bin/python" SPHINXBUILD="./venv/bin/python -m sphinx" SPHINXOPTS="-q -W"
4343
- os: linux
4444
language: c
45-
compiler: clang
45+
compiler: gcc
4646
env:
4747
- TESTING=coverage
4848
before_script:
4949
- |
50-
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(rst|yml)$)|(^Doc)/'
50+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(rst|yml)$)|(^Doc)|(^Misc)/'
5151
then
5252
echo "Only docs were updated, stopping build process."
5353
exit
@@ -64,20 +64,11 @@ matrix:
6464
# Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
6565
- source ./venv/bin/activate
6666
- bash <(curl -s https://codecov.io/bash)
67-
- os: linux
68-
language: cpp
69-
compiler: clang
70-
env:
71-
- TESTING="C++ header compatibility"
72-
before_script:
73-
- ./configure
74-
script:
75-
- echo '#include "Python.h"' > test.cc && $CXX -c test.cc -o /dev/null -I ./Include -I .
7667

7768
# Travis provides only 2 cores, so don't overdue the parallelism and waste memory.
7869
before_script:
7970
- |
80-
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(rst|yml)$)|(^Doc)/'
71+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(rst|yml)$)|(^Doc)|(^Misc)/'
8172
then
8273
echo "Only docs were updated, stopping build process."
8374
exit

Doc/c-api/arg.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ which disallows mutable objects such as :class:`bytearray`.
138138
attempting any conversion. Raises :exc:`TypeError` if the object is not
139139
a :class:`bytearray` object. The C variable may also be declared as :c:type:`PyObject\*`.
140140

141-
``u`` (:class:`str`) [Py_UNICODE \*]
141+
``u`` (:class:`str`) [const Py_UNICODE \*]
142142
Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of
143143
Unicode characters. You must pass the address of a :c:type:`Py_UNICODE`
144144
pointer variable, which will be filled with the pointer to an existing
@@ -151,16 +151,16 @@ which disallows mutable objects such as :class:`bytearray`.
151151
Previously, :exc:`TypeError` was raised when embedded null code points
152152
were encountered in the Python string.
153153

154-
``u#`` (:class:`str`) [Py_UNICODE \*, int]
154+
``u#`` (:class:`str`) [const Py_UNICODE \*, int]
155155
This variant on ``u`` stores into two C variables, the first one a pointer to a
156156
Unicode data buffer, the second one its length. This variant allows
157157
null code points.
158158

159-
``Z`` (:class:`str` or ``None``) [Py_UNICODE \*]
159+
``Z`` (:class:`str` or ``None``) [const Py_UNICODE \*]
160160
Like ``u``, but the Python object may also be ``None``, in which case the
161161
:c:type:`Py_UNICODE` pointer is set to *NULL*.
162162

163-
``Z#`` (:class:`str` or ``None``) [Py_UNICODE \*, int]
163+
``Z#`` (:class:`str` or ``None``) [const Py_UNICODE \*, int]
164164
Like ``u#``, but the Python object may also be ``None``, in which case the
165165
:c:type:`Py_UNICODE` pointer is set to *NULL*.
166166

@@ -529,42 +529,42 @@ Building values
529529
not within format units such as ``s#``). This can be used to make long format
530530
strings a tad more readable.
531531
532-
``s`` (:class:`str` or ``None``) [char \*]
532+
``s`` (:class:`str` or ``None``) [const char \*]
533533
Convert a null-terminated C string to a Python :class:`str` object using ``'utf-8'``
534534
encoding. If the C string pointer is *NULL*, ``None`` is used.
535535
536-
``s#`` (:class:`str` or ``None``) [char \*, int]
536+
``s#`` (:class:`str` or ``None``) [const char \*, int]
537537
Convert a C string and its length to a Python :class:`str` object using ``'utf-8'``
538538
encoding. If the C string pointer is *NULL*, the length is ignored and
539539
``None`` is returned.
540540
541-
``y`` (:class:`bytes`) [char \*]
541+
``y`` (:class:`bytes`) [const char \*]
542542
This converts a C string to a Python :class:`bytes` object. If the C
543543
string pointer is *NULL*, ``None`` is returned.
544544
545-
``y#`` (:class:`bytes`) [char \*, int]
545+
``y#`` (:class:`bytes`) [const char \*, int]
546546
This converts a C string and its lengths to a Python object. If the C
547547
string pointer is *NULL*, ``None`` is returned.
548548
549-
``z`` (:class:`str` or ``None``) [char \*]
549+
``z`` (:class:`str` or ``None``) [const char \*]
550550
Same as ``s``.
551551
552-
``z#`` (:class:`str` or ``None``) [char \*, int]
552+
``z#`` (:class:`str` or ``None``) [const char \*, int]
553553
Same as ``s#``.
554554
555-
``u`` (:class:`str`) [Py_UNICODE \*]
555+
``u`` (:class:`str`) [const Py_UNICODE \*]
556556
Convert a null-terminated buffer of Unicode (UCS-2 or UCS-4) data to a Python
557557
Unicode object. If the Unicode buffer pointer is *NULL*, ``None`` is returned.
558558
559-
``u#`` (:class:`str`) [Py_UNICODE \*, int]
559+
``u#`` (:class:`str`) [const Py_UNICODE \*, int]
560560
Convert a Unicode (UCS-2 or UCS-4) data buffer and its length to a Python
561561
Unicode object. If the Unicode buffer pointer is *NULL*, the length is ignored
562562
and ``None`` is returned.
563563
564-
``U`` (:class:`str` or ``None``) [char \*]
564+
``U`` (:class:`str` or ``None``) [const char \*]
565565
Same as ``s``.
566566
567-
``U#`` (:class:`str` or ``None``) [char \*, int]
567+
``U#`` (:class:`str` or ``None``) [const char \*, int]
568568
Same as ``s#``.
569569
570570
``i`` (:class:`int`) [int]

Doc/c-api/bytes.rst

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,34 @@ called with a non-bytes parameter.
7272
| :attr:`%c` | int | A single byte, |
7373
| | | represented as a C int. |
7474
+-------------------+---------------+--------------------------------+
75-
| :attr:`%d` | int | Exactly equivalent to |
76-
| | | ``printf("%d")``. |
75+
| :attr:`%d` | int | Equivalent to |
76+
| | | ``printf("%d")``. [1]_ |
7777
+-------------------+---------------+--------------------------------+
78-
| :attr:`%u` | unsigned int | Exactly equivalent to |
79-
| | | ``printf("%u")``. |
78+
| :attr:`%u` | unsigned int | Equivalent to |
79+
| | | ``printf("%u")``. [1]_ |
8080
+-------------------+---------------+--------------------------------+
81-
| :attr:`%ld` | long | Exactly equivalent to |
82-
| | | ``printf("%ld")``. |
81+
| :attr:`%ld` | long | Equivalent to |
82+
| | | ``printf("%ld")``. [1]_ |
8383
+-------------------+---------------+--------------------------------+
84-
| :attr:`%lu` | unsigned long | Exactly equivalent to |
85-
| | | ``printf("%lu")``. |
84+
| :attr:`%lu` | unsigned long | Equivalent to |
85+
| | | ``printf("%lu")``. [1]_ |
8686
+-------------------+---------------+--------------------------------+
87-
| :attr:`%zd` | Py_ssize_t | Exactly equivalent to |
88-
| | | ``printf("%zd")``. |
87+
| :attr:`%zd` | Py_ssize_t | Equivalent to |
88+
| | | ``printf("%zd")``. [1]_ |
8989
+-------------------+---------------+--------------------------------+
90-
| :attr:`%zu` | size_t | Exactly equivalent to |
91-
| | | ``printf("%zu")``. |
90+
| :attr:`%zu` | size_t | Equivalent to |
91+
| | | ``printf("%zu")``. [1]_ |
9292
+-------------------+---------------+--------------------------------+
93-
| :attr:`%i` | int | Exactly equivalent to |
94-
| | | ``printf("%i")``. |
93+
| :attr:`%i` | int | Equivalent to |
94+
| | | ``printf("%i")``. [1]_ |
9595
+-------------------+---------------+--------------------------------+
96-
| :attr:`%x` | int | Exactly equivalent to |
97-
| | | ``printf("%x")``. |
96+
| :attr:`%x` | int | Equivalent to |
97+
| | | ``printf("%x")``. [1]_ |
9898
+-------------------+---------------+--------------------------------+
99-
| :attr:`%s` | char\* | A null-terminated C character |
99+
| :attr:`%s` | const char\* | A null-terminated C character |
100100
| | | array. |
101101
+-------------------+---------------+--------------------------------+
102-
| :attr:`%p` | void\* | The hex representation of a C |
102+
| :attr:`%p` | const void\* | The hex representation of a C |
103103
| | | pointer. Mostly equivalent to |
104104
| | | ``printf("%p")`` except that |
105105
| | | it is guaranteed to start with |
@@ -111,6 +111,9 @@ called with a non-bytes parameter.
111111
An unrecognized format character causes all the rest of the format string to be
112112
copied as-is to the result object, and any extra arguments discarded.
113113
114+
.. [1] For integer specifiers (d, u, ld, lu, zd, zu, i, x): the 0-conversion
115+
flag has effect even when a precision is given.
116+
114117
115118
.. c:function:: PyObject* PyBytes_FromFormatV(const char *format, va_list vargs)
116119

Doc/c-api/dict.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Dictionary Objects
7272
.. index:: single: PyUnicode_FromString()
7373
7474
Insert *value* into the dictionary *p* using *key* as a key. *key* should
75-
be a :c:type:`char\*`. The key object is created using
75+
be a :c:type:`const char\*`. The key object is created using
7676
``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on
7777
failure.
7878
@@ -107,7 +107,7 @@ Dictionary Objects
107107
.. c:function:: PyObject* PyDict_GetItemString(PyObject *p, const char *key)
108108
109109
This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a
110-
:c:type:`char\*`, rather than a :c:type:`PyObject\*`.
110+
:c:type:`const char\*`, rather than a :c:type:`PyObject\*`.
111111
112112
113113
.. c:function:: PyObject* PyDict_SetDefault(PyObject *p, PyObject *key, PyObject *default)

0 commit comments

Comments
 (0)