Commit Graph

107385 Commits

Author SHA1 Message Date
Miss Islington (bot) b90b61f231
Ensure correct version of Sphinx is used for Windows builds (GH-20582)
(cherry picked from commit fe5dd78182)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-06-01 14:24:10 -07:00
Huon Wilson 3c7609a23c
[3.9] bpo-40630: Add tracemalloc.reset_peak (GH-20102) (GH-20545)
* bpo-40630: Add tracemalloc.reset_peak (GH-20102, cherrypick 8b62644)

The reset_peak function sets the peak memory size to the current size,
representing a resetting of that metric. This allows for recording the
peak of specific sections of code, ignoring other code that may have
had a higher peak (since the most recent `tracemalloc.start()` or
tracemalloc.clear_traces()` call).

* Adjust docs to point to 3.9
2020-06-01 19:26:22 +02:00
Miss Islington (bot) 410b730c20
Make sure that keyword arguments are merged into the arguments dictionary when dict unpacking and keyword arguments are interleaved. (GH-20553) (GH-20569)
(cherry picked from commit db64f12e4d)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2020-06-01 17:07:32 +01:00
Miss Islington (bot) a169961dfc
bpo-40831: Remove an incorrect statement in the Windows docs (GH-20570)
(cherry picked from commit c8966667bb)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-06-01 08:53:27 -07:00
Miss Islington (bot) 24a88b008b
bpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)
Fix :mod:`ssl`` code to be compatible with OpenSSL 1.1.x builds that use
``no-deprecated`` and ``--api=1.1.0``.

Note: Tests assume full OpenSSL API and fail with limited API.

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Mark Wright <gienah@gentoo.org>
(cherry picked from commit a871f692b4)

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-01 00:18:39 -07:00
Miss Islington (bot) 0a674638a3
bpo-17005: Move topological sort functionality to its own module (GH-20558)
The topological sort functionality that was introduced initially in the
functools module has been moved to a new graphlib module to
better accommodate the new tools and keep the original scope of the
functools module.
(cherry picked from commit 2f172d8f15)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-05-31 17:01:37 -07:00
Miss Islington (bot) a176b314e7
Fix typo in "What's new in Python 3.9" (GH-20559)
Automerge-Triggered-By: @pablogsal
(cherry picked from commit 491a3d3a75)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-05-31 16:35:24 -07:00
Miss Islington (bot) 96d91071c0
bpo-40759: Deprecate the symbol module (GH-20364)
Automerge-Triggered-By: @pablogsal
(cherry picked from commit cf88871d6a)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2020-05-31 15:23:29 -07:00
Miss Islington (bot) cdb015b7ed
Fix asyncio.to_thread() documented return type (GH-20547)
When I wrote the documentation for `asyncio.to_thread()`, I mistakenly assumed that `return await loop.run_in_executor(...)` within an async def function would return a Future. In reality, it returns a coroutine.

This likely won't affect typical usage of `asyncio.to_thread()`, but it's important for the documentation to be correct here. In general, we also tend to avoid returning futures from high-level APIs in asyncio.
(cherry picked from commit 2b201369b4)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-05-31 00:26:20 -07:00
Miss Islington (bot) 44400e88f9
bpo-40829: Add a what's new entry about deprecation of shuffle's random parameter (GH-20541) (GH-20544) 2020-05-30 15:33:06 -07:00
Miss Islington (bot) 588efc29c5
bpo-40798: Generate a different message for already removed elements (GH-20483)
(cherry picked from commit 735d902b36)

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
2020-05-30 00:54:28 -07:00
Miss Islington (bot) 78cf711d1f
closes bpo-29017: Update the bindings for Qt information with PySide2 (GH-20149)
Reference to PySide has been removed has it is for Qt 4, which has reached end of life.
(cherry picked from commit 4649202ea7)

Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-05-29 19:04:25 -07:00
Miss Islington (bot) 9f3f70fd0b
bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
Leave selection when right click within.  This exception to clearing selections when right-clicking was omitted from the previous commit, 4ca060d.  I did not realize that this completely disabled the context menu entries, and  I should have merged a minimal fix immediately.  An automated test should follow.
(cherry picked from commit 97e4e0f53d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-05-29 16:13:21 -07:00
Miss Islington (bot) 805fa54676
Further de-linting of zoneinfo module (GH-20499)
* Remove unused imports in zoneinfo

* Remove unused variables in zoneinfo

* Remove else after raise
(cherry picked from commit 364b5ead15)

Co-authored-by: Paul Ganssle <paul@ganssle.io>
2020-05-29 06:53:52 -07:00
Miss Islington (bot) ad088ca5c6
bpo-40780: Fix failure of _Py_dg_dtoa to remove trailing zeros (GH-20435) (GH-20514)
* Fix failure of _Py_dg_dtoa to remove trailing zeros

* Add regression test and news entry

* Add explanation about why it's safe to strip trailing zeros

* Make code safer, clean up comments, add change note at top of file

* Nitpick: avoid implicit int-to-float conversion in tests
(cherry picked from commit 895c9c1d43)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2020-05-29 14:46:54 +01:00
Miss Islington (bot) 8fcc1474ef
bpo-40784: Fix sqlite3 deterministic test (GH-20448)
(cherry picked from commit c610d970f5)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-05-29 05:46:52 -07:00
Miss Islington (bot) a6ae02d7e9
bpo-39040: Fix parsing of email mime headers with whitespace between encoded-words. (gh-17620)
* bpo-39040: Fix parsing of email headers with encoded-words inside a quoted string.

It is fairly common to find malformed mime headers (especially content-disposition
headers) where the parameter values, instead of being encoded to RFC
standards, are "encoded" by doing RFC 2047 "encoded word" encoding, and
then enclosing the whole thing in quotes.  The processing of these malformed
headers was incorrectly leaving the spaces between encoded words in the decoded
text (whitespace between adjacent encoded words is supposed to be stripped on
decoding).  This changeset fixes the encoded word processing inside quoted strings
(bare-quoted-string) to do correct RFC 2047 decoding by stripping that
whitespace.
(cherry picked from commit 21017ed904)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2020-05-29 04:43:06 -07:00
Miss Islington (bot) 8e5f11d1f8
Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs (GH-20509)
(cherry picked from commit 2831642212)

Co-authored-by: Windson yang <wiwindson@outlook.com>
2020-05-29 04:42:40 -07:00
Miss Islington (bot) 6637bd4516
bpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)
(cherry picked from commit dc4eee9e26)

Co-authored-by: Fantix King <fantix.king@gmail.com>
2020-05-28 15:17:33 -07:00
Miss Islington (bot) 1a7e34cd62
Note the output ordering of combinatoric functions (GH-19732) (GH-20501) 2020-05-28 13:32:36 -07:00
Miss Islington (bot) e4cc3a7c1f
bpo-40806: itertools.product immediately consumes its inputs (GH-20492) (GH-20498) 2020-05-28 09:58:33 -07:00
Miss Islington (bot) eceee544de
[3.9] bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time (GH-20493) (GH-20495)
Recent changes to _datetimemodule broke compilation on mingw; see the comments in this change for details.

FWIW, @corona10: this issue is why `PyType_FromModuleAndSpec` & friends take the `bases` argument at run time.
(cherry picked from commit 459acc5516)


Co-authored-by: Petr Viktorin <encukou@gmail.com>
2020-05-28 09:41:41 -07:00
Miss Islington (bot) a5936ad632
bpo-1294959: Try to clarify the meaning of platlibdir (GH-20332)
Try to make the meaning of platlibdir clear.  The previous wording could
be misinterpreted to suggest that it will be used to find all shared
libraries on the system, and not just Python extensions.  Furthermore,
it was unclear whether it affects third-party (site-packages) extensions
or not.  The new wording tries to make its dual purpose clear,
and provide the additional example of extensions in site-packages.
(cherry picked from commit 242d95659b)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
2020-05-28 09:41:31 -07:00
Miss Islington (bot) 6a478641c0
bpo-37878: PyThreadState_DeleteCurrent() was not removed (GH-20489)
Update What's New in Python 3.9.

PyThreadState_DeleteCurrent was not removed, but excluded from the limited C API.
(cherry picked from commit fda7f6d61b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-28 09:34:47 -07:00
Miss Islington (bot) bcbe5c59dd
bpo-40217: Ensure Py_VISIT(Py_TYPE(self)) is always called for PyType_FromSpec types (reverts GH-19414) (GH-20264)
Heap types now always visit the type in tp_traverse. See added docs for details.

This reverts commit 0169d3003b.

Automerge-Triggered-By: @encukou
(cherry picked from commit 1cf15af9a6)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-05-28 08:12:23 -07:00
Miss Islington (bot) 1d82f00367
bpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)
Skip new "racing" socket tests which fail randomly until someone fix
them, to ease analysis of buildbot failures (skip tests which are
known to be broken/unstable).
(cherry picked from commit 84ee7e1573)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-28 07:28:17 -07:00
Christian Heimes 8183e11d87
[3.9] bpo-40791: Use CRYPTO_memcmp() for compare_digest (GH-20456) (GH-20461)
hashlib.compare_digest uses OpenSSL's CRYPTO_memcmp() function
when OpenSSL is available.

Note: The _operator module is a builtin module. I don't want to add
libcrypto dependency to libpython. Therefore I duplicated the wrapper
function and added a copy to _hashopenssl.c..
(cherry picked from commit db5aed931f)

Co-authored-by: Christian Heimes <christian@python.org>
2020-05-28 05:09:38 -07:00
Miss Islington (bot) d23ee5d652
Improve IO tutorial's "Old string formatting" section (GH-16251)
* Use a more universal explanation of string interpolation rather than specifically referencing sprintf(), which depends on the reader having a C background.

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit eaca2aa117)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2020-05-27 18:41:38 -07:00
Miss Islington (bot) de6b684109
bpo-39939: Fix removeprefix issue number in the What's New in Python 3.9 (GH-20473) (GH-20474)
(cherry picked from commit 56853d8ec6)

Co-authored-by: Elazar Gershuni <elazarg@gmail.com>

Co-authored-by: Elazar Gershuni <elazarg@gmail.com>
2020-05-28 03:24:33 +02:00
Miss Islington (bot) 9e3c583954
bpo-40795: ctypes calls unraisablehook with an exception (GH-20452)
If ctypes fails to convert the result of a callback or if a ctypes
callback function raises an exception, sys.unraisablehook is now
called with an exception set. Previously, the error was logged into
stderr by PyErr_Print().
(cherry picked from commit 10228bad04)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-27 16:00:01 -07:00
Miss Islington (bot) be240b8571
Fix compiler warnings in _zoneinfo.c (GH-20342)
```
D:\a\cpython\cpython\Modules\_zoneinfo.c(903,52): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
D:\a\cpython\cpython\Modules\_zoneinfo.c(904,44): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
D:\a\cpython\cpython\Modules\_zoneinfo.c(1772,31): warning C4244: '=': conversion from 'ssize_t' to 'uint8_t', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
```
(cherry picked from commit e4799b9594)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-05-27 14:08:20 -07:00
Pablo Galindo 9b83829e7d
[3.9] bpo-40614: Respect feature version for f-string debug expressions (GH-20196) (GH-20464)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit c116c94)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-05-27 22:01:11 +01:00
Miss Islington (bot) 3a2667d91e
bpo-30064: Fix asyncio loop.sock_* race condition issue (GH-20369)
(cherry picked from commit 210a137396)

Co-authored-by: Fantix King <fantix.king@gmail.com>
2020-05-27 13:39:03 -07:00
Lysandros Nikolaou c011d1b5be
[3.9] Backport GH-20440: Set p->error_indicator in more places (GH-20457) 2020-05-27 21:20:43 +01:00
Lysandros Nikolaou 1bfe659ee5
[3.9] Backport GH-20370 and GH-20436: Soft keywords (GH-20458) 2020-05-27 21:20:07 +01:00
Miss Islington (bot) 788d7bfe18
bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
ctypes now raises an ArgumentError when a callback
is invoked with more than 1024 arguments.

The ctypes module allocates arguments on the stack in
ctypes_callproc() using alloca(), which is problematic
when large numbers of arguments are passed. Instead
of a stack overflow, this commit raises an ArgumentError
if more than 1024 parameters are passed.
(cherry picked from commit 29a1384c04)

Co-authored-by: Sean Gillespie <sean@swgillespie.me>
2020-05-27 08:46:57 -07:00
Miss Islington (bot) 43fccb1875
Fix the link to ncurses patch download in macos installer build script (GH-20421)
Reason: the link `ftp://invisible-island.net/ncurses//5.9/ncurses-5.9-20120616-patch.sh.bz2` is dead, which prevents `Mac/BuildScript/build-installer.py` from completing. Looks like the host of the FTP server was changed to `ftp.invisible-island.net`, thus this proposal.

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
(cherry picked from commit 7da46b676a)

Co-authored-by: Oleg Höfling <hoefling@users.noreply.github.com>
2020-05-27 03:32:25 -07:00
Miss Islington (bot) 1c88bf8541
bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
(cherry picked from commit db098bc1f0)

Co-authored-by: idomic <michael.ido@gmail.com>
2020-05-26 08:13:33 -07:00
Miss Islington (bot) 500cd89ecc
bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832)
(cherry picked from commit 372ee27d49)

Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2020-05-26 06:38:18 -07:00
Miss Islington (bot) 7df9c41c69
bpo-40737: Fix possible reference leak for sqlite3 initialization (GH-20323)
(cherry picked from commit 5eb45d7d4e)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-05-26 05:38:51 -07:00
Miss Islington (bot) 66391b0c6e
bpo-40637: Fix test_pbkdf2_hmac_py for missing sha1 (GH-20422)
(cherry picked from commit be63019ed7)

Co-authored-by: Christian Heimes <christian@python.org>
2020-05-26 03:46:24 -07:00
Miss Islington (bot) cc0f50d62c
bpo-39301: State that floor division is used for right shift operations (GH-20347) (GH-20414)
* bpo-39301: State that floor division is used for right shift operations

* Remove "without overflow check"
(cherry picked from commit af7553ac95)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-05-26 09:33:10 +01:00
Miss Islington (bot) 5221a10dde
bpo-35714: Reject null characters in struct format strings (GH-16928)
struct.error is now raised if there is a null character in a struct
format string.
(cherry picked from commit 3f59b55316)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-05-26 00:04:59 -07:00
Miss Islington (bot) a729f4abb8
Simplify creation of the __new__ method in namedtuple() (GH-20361) (GH-20409) 2020-05-25 22:00:31 -07:00
Miss Islington (bot) fda47659bb
Fix peg_generator compiler warnings under MSVC (GH-20405)
(cherry picked from commit a2bbedc8b1)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2020-05-25 21:52:21 -07:00
Miss Islington (bot) 6597e2af83
bpo-40745: Fix typos in NewType docs (GH-20379)
(cherry picked from commit 2b0e654f91)

Co-authored-by: ziheng <zihenglv@gmail.com>
2020-05-25 21:52:14 -07:00
Benjamin Peterson b03e0ee226
[3.9] closes bpo-40774: Fix docs indentation for asyncio.create_subprocess_shell() (GH-20403) (#20407)
(cherry picked from commit 4a0ac42)

Co-authored-by: sth <sth.dev@tejp.de>
2020-05-25 23:19:42 -05:00
Lysandros Nikolaou 791a46ed58
[3.9] bpo-38964: Print correct filename on a SyntaxError in an fstring (GH-20399) (GH-20404)
When a `SyntaxError` in the expression part of a fstring is found,
the filename attribute of the `SyntaxError` is always `<fstring>`.
With this commit, it gets changed to always have the name of the file
the fstring resides in.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>.
(cherry picked from commit f7b1e46156)
2020-05-26 02:24:31 +01:00
Lysandros Nikolaou 6cb0ad2039
bpo-40246: Fix test_fstring when run with the old parser (GH-20402) 2020-05-26 01:10:00 +01:00
Miss Islington (bot) 3c6c86ab77
bpo-40688: Use the correct parser in the peg_generator scripts (GH-20235)
The scripts in `Tools/peg_generator/scripts` mostly assume that
`ast.parse` and `compile` use the old parser, since this was the
state of things, while we were developing them. They need to be
updated to always use the correct parser. `_peg_parser` is being
extended to support both parsing and compiling with both parsers.
(cherry picked from commit 9645930b5b)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-05-25 13:11:36 -07:00