Skip to content

Commit 07a979f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into bpo-30555-windowsconsoleio-fd-redirection
2 parents 9dd4ea9 + 67ba4fa commit 07a979f

393 files changed

Lines changed: 48542 additions & 43818 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.

.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ branches:
88
build_script:
99
- cmd: PCbuild\build.bat -e
1010
test_script:
11-
- cmd: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
11+
- cmd: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 --fail-env-changed -j0
1212

1313
# Only trigger AppVeyor if actual code or its configuration changes
1414
only_commits:

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,29 @@ matrix:
7171
# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
7272
before_script:
7373
- |
74+
set -e
7475
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`.
8498
- make buildbottest TESTOPTS="-j4 -uall,-cpu,-tzdata"
8599

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

Doc/c-api/module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Module Objects
5050
5151
.. c:function:: PyObject* PyModule_New(const char *name)
5252
53-
Similar to :c:func:`PyImport_NewObject`, but the name is a UTF-8 encoded
53+
Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded
5454
string instead of a Unicode object.
5555
5656

Doc/c-api/unicode.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -934,16 +934,22 @@ wchar_t Support
934934
Convert the Unicode object to a wide character string. The output string
935935
always ends with a null character. If *size* is not *NULL*, write the number
936936
of wide characters (excluding the trailing null termination character) into
937-
*\*size*.
937+
*\*size*. Note that the resulting :c:type:`wchar_t` string might contain
938+
null characters, which would cause the string to be truncated when used with
939+
most C functions. If *size* is *NULL* and the :c:type:`wchar_t*` string
940+
contains null characters a :exc:`ValueError` is raised.
938941
939942
Returns a buffer allocated by :c:func:`PyMem_Alloc` (use
940-
:c:func:`PyMem_Free` to free it) on success. On error, returns *NULL*,
941-
*\*size* is undefined and raises a :exc:`MemoryError`. Note that the
942-
resulting :c:type:`wchar_t` string might contain null characters, which
943-
would cause the string to be truncated when used with most C functions.
943+
:c:func:`PyMem_Free` to free it) on success. On error, returns *NULL*
944+
and *\*size* is undefined. Raises a :exc:`MemoryError` if memory allocation
945+
is failed.
944946
945947
.. versionadded:: 3.2
946948
949+
.. versionchanged:: 3.7
950+
Raises a :exc:`ValueError` if *size* is *NULL* and the :c:type:`wchar_t*`
951+
string contains null characters.
952+
947953
948954
.. _builtincodecs:
949955

Doc/faq/gui.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,6 @@ Python bindings for `the FLTK toolkit <http://www.fltk.org>`_, a simple yet
9494
powerful and mature cross-platform windowing system, are available from `the
9595
PyFLTK project <http://pyfltk.sourceforge.net>`_.
9696

97-
98-
FOX
99-
----
100-
101-
A wrapper for `the FOX toolkit <http://www.fox-toolkit.org/>`_ called `FXpy
102-
<http://fxpy.sourceforge.net/>`_ is available. FOX supports both Unix variants
103-
and Windows.
104-
105-
10697
OpenGL
10798
------
10899

Doc/howto/descriptor.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ to wrap access to the value attribute in a property data descriptor::
252252

253253
class Cell(object):
254254
. . .
255-
def getvalue(self, obj):
256-
"Recalculate cell before returning value"
255+
def getvalue(self):
256+
"Recalculate the cell before returning value"
257257
self.recalc()
258-
return obj._value
258+
return self._value
259259
value = property(getvalue)
260260

261261

Doc/library/asyncio-protocol.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,17 @@ WriteTransport
163163

164164
Set the *high*- and *low*-water limits for write flow control.
165165

166-
These two values control when call the protocol's
166+
These two values (measured in number of
167+
bytes) control when the protocol's
167168
:meth:`pause_writing` and :meth:`resume_writing` methods are called.
168169
If specified, the low-water limit must be less than or equal to the
169170
high-water limit. Neither *high* nor *low* can be negative.
170171

172+
:meth:`pause_writing` is called when the buffer size becomes greater
173+
than or equal to the *high* value. If writing has been paused,
174+
:meth:`resume_writing` is called when the buffer size becomes less
175+
than or equal to the *low* value.
176+
171177
The defaults are implementation-specific. If only the
172178
high-water limit is given, the low-water limit defaults to an
173179
implementation-specific value less than or equal to the

Doc/library/collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ field names, the method and attribute names start with an underscore.
866866
.. versionchanged:: 3.1
867867
Returns an :class:`OrderedDict` instead of a regular :class:`dict`.
868868

869-
.. method:: somenamedtuple._replace(kwargs)
869+
.. method:: somenamedtuple._replace(**kwargs)
870870

871871
Return a new instance of the named tuple replacing specified fields with new
872872
values::

0 commit comments

Comments
 (0)