]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agoEnsure correct version of Sphinx is used for Windows builds (GH-20582)
Steve Dower [Mon, 1 Jun 2020 21:17:23 +0000 (22:17 +0100)] 
Ensure correct version of Sphinx is used for Windows builds (GH-20582)

5 years agobpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)
Victor Stinner [Mon, 1 Jun 2020 18:59:35 +0000 (20:59 +0200)] 
bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)

Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.

Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.

5 years agobpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h (GH-18413)
Skip Montanaro [Mon, 1 Jun 2020 18:35:56 +0000 (13:35 -0500)] 
bpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h (GH-18413)

5 years agobpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)
Victor Stinner [Mon, 1 Jun 2020 18:34:15 +0000 (20:34 +0200)] 
bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)

PyOS_InterruptOccurred() now fails with a fatal error if it is called
with the GIL released.

5 years agobpo-40630: adjust tracemalloc.reset_peak docs for backport to 3.9 (GH-20546)
Huon Wilson [Mon, 1 Jun 2020 17:26:33 +0000 (03:26 +1000)] 
bpo-40630: adjust tracemalloc.reset_peak docs for backport to 3.9 (GH-20546)

5 years agobpo-39943: Fix MSVC warnings in sre extension (GH-20508)
Ammar Askar [Mon, 1 Jun 2020 17:21:43 +0000 (17:21 +0000)] 
bpo-39943: Fix MSVC warnings in sre extension (GH-20508)

5 years agobpo-39593: Add test on ctypes cfield.c s_set() (GH-18424)
Hai Shi [Mon, 1 Jun 2020 16:54:18 +0000 (00:54 +0800)] 
bpo-39593: Add test on ctypes cfield.c s_set() (GH-18424)

5 years agobpo-1635741: Port fcntl module to multiphase initialization (GH-20540)
Dong-hee Na [Mon, 1 Jun 2020 16:12:24 +0000 (01:12 +0900)] 
bpo-1635741: Port fcntl module to multiphase initialization (GH-20540)

5 years agobpo-40831: Remove an incorrect statement in the Windows docs (GH-20570)
Zackery Spytz [Mon, 1 Jun 2020 15:43:56 +0000 (09:43 -0600)] 
bpo-40831: Remove an incorrect statement in the Windows docs (GH-20570)

5 years agobpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)
Victor Stinner [Mon, 1 Jun 2020 14:02:40 +0000 (16:02 +0200)] 
bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)

Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if
tstate is NULL, the error message contains the current function name.

5 years agoMake sure that keyword arguments are merged into the arguments dictionary when dict...
Mark Shannon [Mon, 1 Jun 2020 09:42:42 +0000 (10:42 +0100)] 
Make sure that keyword arguments are merged into the arguments dictionary when dict unpacking and keyword arguments are interleaved. (GH-20553)

5 years agobpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)
Christian Heimes [Mon, 1 Jun 2020 06:58:14 +0000 (08:58 +0200)] 
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>
5 years agobpo-17005: Move topological sort functionality to its own module (GH-20558)
Pablo Galindo [Sun, 31 May 2020 23:41:14 +0000 (00:41 +0100)] 
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.

5 years agoFix typo in "What's new in Python 3.9" (GH-20559)
Lysandros Nikolaou [Sun, 31 May 2020 23:28:46 +0000 (02:28 +0300)] 
Fix typo in "What's new in Python 3.9" (GH-20559)

Automerge-Triggered-By: @pablogsal
5 years agobpo-40759: Deprecate the symbol module (GH-20364)
Batuhan Taskaya [Sun, 31 May 2020 22:01:50 +0000 (01:01 +0300)] 
bpo-40759: Deprecate the symbol module (GH-20364)

Automerge-Triggered-By: @pablogsal
5 years agobpo-40755: Add rich comparisons to Counter (GH-20548)
Raymond Hettinger [Sun, 31 May 2020 21:57:42 +0000 (14:57 -0700)] 
bpo-40755: Add rich comparisons to Counter (GH-20548)

5 years agoFix asyncio.to_thread() documented return type (GH-20547)
Kyle Stanley [Sun, 31 May 2020 07:07:04 +0000 (03:07 -0400)] 
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.

5 years agobpo-40829: Add a what's new entry about deprecation of shuffle's random parameter...
Batuhan Taskaya [Sat, 30 May 2020 22:15:06 +0000 (01:15 +0300)] 
bpo-40829: Add a what's new entry about deprecation of shuffle's random parameter (GH-20541)

5 years agobpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748)
Zackery Spytz [Sat, 30 May 2020 08:22:02 +0000 (02:22 -0600)] 
bpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748)

tup should be decrefed in the unlikely event of a PyList_New()
failure.

5 years agobpo-40798: Generate a different message for already removed elements (GH-20483)
Florian Dahlitz [Sat, 30 May 2020 07:47:32 +0000 (09:47 +0200)] 
bpo-40798: Generate a different message for already removed elements (GH-20483)

5 years agocloses bpo-29017: Update the bindings for Qt information with PySide2 (GH-20149)
Samuel Gaist [Sat, 30 May 2020 01:57:03 +0000 (03:57 +0200)] 
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.

5 years agobpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
Terry Jan Reedy [Fri, 29 May 2020 22:54:14 +0000 (18:54 -0400)] 
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.

5 years agobpo-29882: Add an efficient popcount method for integers (#771)
Niklas Fiekas [Fri, 29 May 2020 16:28:02 +0000 (18:28 +0200)] 
bpo-29882: Add an efficient popcount method for integers (#771)

* bpo-29882: Add an efficient popcount method for integers

* Update 'sign bit' and versionadded in docs

* Add entry to whatsnew document

* Doc: use positive example, mention population count

* Minor cleanups of the core code

* Move popcount_digit closer to where it's used

* Use z instead of self after conversion

* Add 'absolute value' and 'population count' to docstring

* Fix clinic error about missing summary line

* Ensure popcount_digit is portable with 64-bit ints

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
5 years agoFurther de-linting of zoneinfo module (#20499)
Paul Ganssle [Fri, 29 May 2020 13:34:30 +0000 (09:34 -0400)] 
Further de-linting of zoneinfo module (#20499)

* Remove unused imports in zoneinfo

* Remove unused variables in zoneinfo

* Remove else after raise

5 years agobpo-40780: Fix failure of _Py_dg_dtoa to remove trailing zeros (GH-20435)
Mark Dickinson [Fri, 29 May 2020 13:23:57 +0000 (14:23 +0100)] 
bpo-40780: Fix failure of _Py_dg_dtoa to remove trailing zeros (GH-20435)

* 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

5 years agoIndicate that abs() method accept argument that implement __abs__(), just like call...
Windson yang [Fri, 29 May 2020 11:35:34 +0000 (19:35 +0800)] 
Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs (GH-20509)

5 years agobpo-39040: Fix parsing of email mime headers with whitespace between encoded-words...
Abhilash Raj [Fri, 29 May 2020 00:04:59 +0000 (17:04 -0700)] 
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.

5 years agobpo-40784: Fix sqlite3 deterministic test (GH-20448)
Erlend Egeberg Aasland [Thu, 28 May 2020 23:27:31 +0000 (01:27 +0200)] 
bpo-40784: Fix sqlite3 deterministic test (GH-20448)

5 years agobpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)
Fantix King [Thu, 28 May 2020 21:56:42 +0000 (16:56 -0500)] 
bpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)

5 years agoNote the output ordering of combinatoric functions (GH-19732)
Ruaridh Williamson [Thu, 28 May 2020 19:56:43 +0000 (20:56 +0100)] 
Note the output ordering of combinatoric functions (GH-19732)

5 years agobpo-40474: Updated coverage.yml to better report coverage stats (#19851)
lrjball [Thu, 28 May 2020 18:51:44 +0000 (19:51 +0100)] 
bpo-40474: Updated coverage.yml to better report coverage stats (#19851)

Currently modules which are imported early are misreported in coverage. A fix is documented in the devguide, but the fix wasn't being used in CI.

5 years agobpo-40806: Clarify that itertools.product immediately consumes its inpt (GH-20492)
Ramil Nugmanov [Thu, 28 May 2020 16:46:22 +0000 (19:46 +0300)] 
bpo-40806: Clarify that itertools.product immediately consumes its inpt (GH-20492)

5 years agobpo-1294959: Try to clarify the meaning of platlibdir (GH-20332)
Michał Górny [Thu, 28 May 2020 16:33:04 +0000 (18:33 +0200)] 
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.

5 years agobpo-37878: PyThreadState_DeleteCurrent() was not removed (GH-20489)
Victor Stinner [Thu, 28 May 2020 16:26:01 +0000 (18:26 +0200)] 
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.

5 years agobpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time (GH-20493)
Petr Viktorin [Thu, 28 May 2020 16:14:46 +0000 (18:14 +0200)] 
bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time (GH-20493)

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.

5 years agobpo-40755: Add missing multiset operations to Counter() (GH-20339)
Raymond Hettinger [Thu, 28 May 2020 15:35:46 +0000 (08:35 -0700)] 
bpo-40755: Add missing multiset operations to Counter() (GH-20339)

5 years agobpo-25920: Remove socket.getaddrinfo() lock on macOS (GH-20177)
Victor Stinner [Thu, 28 May 2020 15:23:39 +0000 (17:23 +0200)] 
bpo-25920: Remove socket.getaddrinfo() lock on macOS (GH-20177)

On macOS, socket.getaddrinfo() no longer uses an internal lock to
prevent race conditions when calling getaddrinfo(). getaddrinfo is
thread-safe is macOS 10.5, whereas Python 3.9 requires macOS 10.6 or
newer.

The lock was also used on FreeBSD older than 5.3, OpenBSD older than
201311 and NetBSD older than 4.

5 years agobpo-40275: Fix test.support.threading_helper (GH-20488)
Victor Stinner [Thu, 28 May 2020 14:37:37 +0000 (16:37 +0200)] 
bpo-40275: Fix test.support.threading_helper (GH-20488)

* Add missing sys import
* Get verbose and gc_collect() from test.support
* Remove unused starttime variable.

Issues spotted by pyflakes.

5 years ago bpo-40275: Remove test.support.TESTFN_ENCODING (GH-20482)
Hai Shi [Thu, 28 May 2020 14:24:39 +0000 (22:24 +0800)] 
 bpo-40275: Remove test.support.TESTFN_ENCODING (GH-20482)

Replace test.support.TESTFN_ENCODING with sys.getfilesystemencoding().

5 years agobpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)
Victor Stinner [Thu, 28 May 2020 14:08:50 +0000 (16:08 +0200)] 
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).

5 years agoRevert "Upgrade bundled versions of pip & setuptools (#16782)" (GH-20484)
Victor Stinner [Thu, 28 May 2020 13:57:49 +0000 (15:57 +0200)] 
Revert "Upgrade bundled versions of pip & setuptools (#16782)" (GH-20484)

This reverts commit feb0846c3a28b05b4cfbc6ab34c764957f3eff55.

5 years agobpo-40792: Make the result of PyNumber_Index() always having exact type int. (GH...
Serhiy Storchaka [Thu, 28 May 2020 07:33:45 +0000 (10:33 +0300)] 
bpo-40792: Make the result of PyNumber_Index() always having exact type int. (GH-20443)

Previously, the result could have been an instance of a subclass of int.

Also revert bpo-26202 and make attributes start, stop and step of the range
object having exact type int.

Add private function _PyNumber_Index() which preserves the old behavior
of PyNumber_Index() for performance to use it in the conversion functions
like PyLong_AsLong().

5 years agoImprove IO tutorial's "Old string formatting" section (GH-16251)
Adorilson Bezerra [Thu, 28 May 2020 01:34:01 +0000 (22:34 -0300)] 
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>
5 years ago bpo-39939: Fix removeprefix issue number in the What's New in Python 3.9 (GH-20473)
Elazar Gershuni [Thu, 28 May 2020 00:41:24 +0000 (03:41 +0300)] 
 bpo-39939: Fix removeprefix issue number in the What's New in Python 3.9 (GH-20473)

5 years agobpo-40275: test.support imports subprocess lazily (GH-20471)
Victor Stinner [Wed, 27 May 2020 23:56:29 +0000 (01:56 +0200)] 
bpo-40275: test.support imports subprocess lazily (GH-20471)

test.support module now imports the platform and subprocess modules
lazily to reduce the number of modules imported by
"import test.support".

With this change, the threading module is no longer imported
indirectly by "import test.support".

Use sys.version rather than platform.machine() to detect the Windows
ARM32 buildbot.

5 years agobpo-40275: test.support.check_impl_detail() uses sys.implementation (GH-20468)
Victor Stinner [Wed, 27 May 2020 22:44:23 +0000 (00:44 +0200)] 
bpo-40275: test.support.check_impl_detail() uses sys.implementation (GH-20468)

check_impl_detail() of test.support now uses sys.implementation.name,
instead of platform.python_implementation().lower(). This change
prepares test.support to import the platform module lazily.

5 years agobpo-40795: ctypes calls unraisablehook with an exception (GH-20452)
Victor Stinner [Wed, 27 May 2020 22:38:12 +0000 (00:38 +0200)] 
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().

5 years agobpo-40275: Adding threading_helper submodule in test.support (GH-20263)
Hai Shi [Wed, 27 May 2020 22:10:27 +0000 (06:10 +0800)] 
bpo-40275: Adding threading_helper submodule in test.support (GH-20263)

5 years agoRevert "bpo-32604: PEP 554 for use in test suite (GH-19985)" (#20465)
Pablo Galindo [Wed, 27 May 2020 21:33:13 +0000 (22:33 +0100)] 
Revert "bpo-32604: PEP 554 for use in test suite (GH-19985)" (#20465)

This reverts commit 9d17cbf33df7cfb67ca0f37f6463ba5c18676641.

5 years agobpo-37129: Add os.RWF_APPEND flag for os.pwritev() (GH-20336)
YoSTEALTH [Wed, 27 May 2020 21:32:22 +0000 (15:32 -0600)] 
bpo-37129: Add os.RWF_APPEND flag for os.pwritev() (GH-20336)

5 years agoFix compiler warnings in _zoneinfo.c (GH-20342)
Pablo Galindo [Wed, 27 May 2020 20:48:12 +0000 (21:48 +0100)] 
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]
```

5 years agobpo-40614: Respect feature version for f-string debug expressions (GH-20196)
Shantanu [Wed, 27 May 2020 20:30:38 +0000 (13:30 -0700)] 
bpo-40614: Respect feature version for f-string debug expressions (GH-20196)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
5 years agobpo-40791: Use CRYPTO_memcmp() for compare_digest (#20456)
Christian Heimes [Wed, 27 May 2020 19:50:06 +0000 (21:50 +0200)] 
bpo-40791: Use CRYPTO_memcmp() for compare_digest (#20456)

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.

5 years agobpo-30064: Fix asyncio loop.sock_* race condition issue (#20369)
Fantix King [Wed, 27 May 2020 19:47:30 +0000 (14:47 -0500)] 
bpo-30064: Fix asyncio loop.sock_* race condition issue (#20369)

5 years agoRefactor error handling code in Parser/pegen/pegen.c (GH-20440)
Lysandros Nikolaou [Wed, 27 May 2020 16:04:11 +0000 (19:04 +0300)] 
Refactor error handling code in Parser/pegen/pegen.c (GH-20440)

Set p->error_indicator in various places, where it's needed, but it's
not done.

Automerge-Triggered-By: @gvanrossum
5 years agobpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
Sean Gillespie [Wed, 27 May 2020 15:22:07 +0000 (08:22 -0700)] 
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.

5 years agobpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429)
Victor Stinner [Wed, 27 May 2020 12:55:10 +0000 (14:55 +0200)] 
bpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429)

Convert Py_REFCNT() and Py_SIZE() macros to static inline functions.
They cannot be used as l-value anymore: use Py_SET_REFCNT() and
Py_SET_SIZE() to set an object reference count and size.

Replace &Py_SIZE(self) with &((PyVarObject*)self)->ob_size
in arraymodule.c.

This change is backward incompatible on purpose, to prepare the C API
for an opaque PyObject structure.

5 years agobpo-37999: Fix outdated __int__ and nb_int references in comments (GH-20449)
Mark Dickinson [Wed, 27 May 2020 12:43:17 +0000 (13:43 +0100)] 
bpo-37999: Fix outdated __int__ and nb_int references in comments (GH-20449)

* Fix outdated __int__ and nb_int references in comments

* Also update C-API documentation

* Add back missing 'method' word

* Remove .. deprecated notices

5 years agoUpgrade bundled versions of pip & setuptools (#16782)
Xavier Fernandez [Wed, 27 May 2020 10:49:34 +0000 (12:49 +0200)] 
Upgrade bundled versions of pip & setuptools (#16782)

5 years agoFix the link to ncurses patch download in macos installer build script (GH-20421)
Oleg Höfling [Wed, 27 May 2020 10:07:15 +0000 (12:07 +0200)] 
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>
5 years agobpo-40217: Ensure Py_VISIT(Py_TYPE(self)) is always called for PyType_FromSpec types...
Pablo Galindo [Wed, 27 May 2020 09:03:38 +0000 (10:03 +0100)] 
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 0169d3003be3d072751dd14a5c84748ab63a249f.

Automerge-Triggered-By: @encukou
5 years agoFix lookahead of soft keywords in the PEG parser (GH-20436)
Pablo Galindo [Tue, 26 May 2020 23:15:52 +0000 (00:15 +0100)] 
Fix lookahead of soft keywords in the PEG parser (GH-20436)

Automerge-Triggered-By: @gvanrossum
5 years agobpo-40611: Adds MAP_POPULATE to the mmap module (GH-20061)
Ethan Steinberg [Tue, 26 May 2020 21:42:18 +0000 (14:42 -0700)] 
bpo-40611: Adds MAP_POPULATE to the mmap module (GH-20061)

MAP_POPULATE constant has now been added to the list of exported
mmap module flags.

5 years agoAdd soft keywords (GH-20370) 9362/head
Guido van Rossum [Tue, 26 May 2020 17:58:44 +0000 (10:58 -0700)] 
Add soft keywords (GH-20370)

These are like keywords but they only work in context; they are not reserved except when there is an exact match.

This would enable things like match statements without reserving `match` (which would be bad for the `re.match()` function and probably lots of other places).

Automerge-Triggered-By: @gvanrossum
5 years agobpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)
Serhiy Storchaka [Tue, 26 May 2020 15:43:38 +0000 (18:43 +0300)] 
bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)

Only __index__ should be used to make integer conversions lossless.

5 years agobpo-40756: Default second argument of LoggerAdapter.__init__ to None (GH-20362)
Arturo Escaip [Tue, 26 May 2020 14:55:21 +0000 (07:55 -0700)] 
bpo-40756: Default second argument of LoggerAdapter.__init__ to None (GH-20362)

The 'extra' argument is not always used by custom logger adapters. For
example:

```python
class IndentAdapter(logging.LoggerAdapter):
    def process(self, msg, kwargs):
        indent = kwargs.pop(indent, 1)
        return ' ' * indent + msg, kwargs
```

It is cleaner and friendlier to default the 'extra' argument to None
instead of either forcing the subclasses of LoggerAdapter to pass a None
value directly or to override the constructor.

This change is backward compatible because existing calls to
`LoggerAdapter.__init__` are already passing a value for the second
argument.

Automerge-Triggered-By: @vsajip
5 years agobpo-39244: multiprocessing return default start method first on macOS (GH-18625)
idomic [Tue, 26 May 2020 14:54:21 +0000 (10:54 -0400)] 
bpo-39244: multiprocessing return default start method first on macOS (GH-18625)

5 years agobpo-40737: Fix possible reference leak for sqlite3 initialization (GH-20323)
Erlend Egeberg Aasland [Tue, 26 May 2020 12:18:19 +0000 (14:18 +0200)] 
bpo-40737: Fix possible reference leak for sqlite3 initialization (GH-20323)

5 years agobpo-40637: Fix test_pbkdf2_hmac_py for missing sha1 (#20422)
Christian Heimes [Tue, 26 May 2020 10:26:29 +0000 (12:26 +0200)] 
bpo-40637: Fix test_pbkdf2_hmac_py for missing sha1 (#20422)

5 years agobpo-39301: State that floor division is used for right shift operations (GH-20347)
Zackery Spytz [Tue, 26 May 2020 08:16:34 +0000 (02:16 -0600)] 
bpo-39301: State that floor division is used for right shift operations (GH-20347)

* bpo-39301: State that floor division is used for right shift operations

* Remove "without overflow check"

5 years agoRemove duplicated words words (GH-20413)
Serhiy Storchaka [Tue, 26 May 2020 08:04:14 +0000 (11:04 +0300)] 
Remove duplicated words words (GH-20413)

5 years agobpo-40745: Fix typos in NewType docs (GH-20379)
ziheng [Tue, 26 May 2020 04:45:35 +0000 (12:45 +0800)] 
bpo-40745: Fix typos in NewType docs (GH-20379)

5 years agoSimplify creation of the __new__ method in namedtuple() (GH-20361)
Raymond Hettinger [Tue, 26 May 2020 04:39:00 +0000 (21:39 -0700)] 
Simplify creation of the __new__ method in namedtuple() (GH-20361)

5 years agoFix peg_generator compiler warnings under MSVC (GH-20405)
Ammar Askar [Tue, 26 May 2020 04:33:35 +0000 (04:33 +0000)] 
Fix peg_generator compiler warnings under MSVC (GH-20405)

5 years agocloses bpo-40774: Fix docs indentation for asyncio.create_subprocess_shell() (GH...
sth [Tue, 26 May 2020 04:08:40 +0000 (06:08 +0200)] 
closes bpo-40774: Fix docs indentation for asyncio.create_subprocess_shell() (GH-20403)

5 years agobpo-38964: Print correct filename on a SyntaxError in an fstring (GH-20399)
Lysandros Nikolaou [Tue, 26 May 2020 00:32:18 +0000 (03:32 +0300)] 
bpo-38964: Print correct filename on a SyntaxError in an fstring (GH-20399)

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>
5 years ago[workflow] Use Sphinx problem matcher on GitHub docs builds (GH-20325)
Ammar Askar [Mon, 25 May 2020 21:32:24 +0000 (21:32 +0000)] 
[workflow] Use Sphinx problem matcher on GitHub docs builds (GH-20325)

5 years agobpo-40688: Use the correct parser in the peg_generator scripts (GH-20235)
Lysandros Nikolaou [Mon, 25 May 2020 19:51:58 +0000 (22:51 +0300)] 
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.

5 years agobpo-23082: Better error message for PurePath.relative_to() from pathlib (GH-19611)
Rotuna [Mon, 25 May 2020 19:42:28 +0000 (21:42 +0200)] 
bpo-23082: Better error message for PurePath.relative_to() from pathlib (GH-19611)

Co-authored-by: Sadhana Srinivasan <rotuna@Sadhanas-MBP.fritz.box>
5 years agoCloses bpo-40558: update CONTRIBUTING.rst to reflect current branches (GH-19989)
Hai Shi [Mon, 25 May 2020 19:19:42 +0000 (03:19 +0800)] 
Closes bpo-40558: update CONTRIBUTING.rst to reflect current branches (GH-19989)

5 years agobpo-40750: Do not expand the new parser debug flags if Py_BUILD_CORE is not defined...
Pablo Galindo [Mon, 25 May 2020 19:17:12 +0000 (20:17 +0100)] 
bpo-40750: Do not expand the new parser debug flags if Py_BUILD_CORE is not defined (GH-20393)

5 years agobpo-40750: Support -d flag in the new parser (GH-20340)
Pablo Galindo [Mon, 25 May 2020 17:38:45 +0000 (18:38 +0100)] 
bpo-40750: Support -d flag in the new parser (GH-20340)

5 years agobpo-39573: Fix buildbot failure for tupleobject.c (GH-20391)
Dong-hee Na [Mon, 25 May 2020 17:25:28 +0000 (02:25 +0900)] 
bpo-39573: Fix buildbot failure for tupleobject.c (GH-20391)

5 years agobpo-39573: Convert Py_TYPE() to a static inline function (GH-20290)
Dong-hee Na [Mon, 25 May 2020 16:52:54 +0000 (01:52 +0900)] 
bpo-39573: Convert Py_TYPE() to a static inline function (GH-20290)

5 years agobpo-39245: Fix docs links to the stable ABI (GH-20388)
Miro Hrončok [Mon, 25 May 2020 15:42:48 +0000 (17:42 +0200)] 
bpo-39245: Fix docs links to the stable ABI (GH-20388)

Automerge-Triggered-By: @vstinner
5 years agobpo-34397: Remove redundant overflow checks in list and tuple implementation. (GH...
Sergey Fedoseev [Mon, 25 May 2020 14:54:40 +0000 (19:54 +0500)] 
bpo-34397: Remove redundant overflow checks in list and tuple implementation. (GH-8757)

5 years agobpo-38972: Fix typos in PowerShell Execution Policies links (GH-20383)
Miro Hrončok [Mon, 25 May 2020 14:54:14 +0000 (16:54 +0200)] 
bpo-38972: Fix typos in PowerShell Execution Policies links (GH-20383)

5 years agobpo-40671: Prepare _hashlib for PEP 489 (GH-20180)
Christian Heimes [Mon, 25 May 2020 08:44:51 +0000 (10:44 +0200)] 
bpo-40671: Prepare _hashlib for PEP 489 (GH-20180)

5 years agobpo-40695: Limit hashlib builtin hash fallback (GH-20259)
Christian Heimes [Mon, 25 May 2020 08:43:10 +0000 (10:43 +0200)] 
bpo-40695: Limit hashlib builtin hash fallback (GH-20259)

:mod:`hashlib` no longer falls back to builtin hash implementations when
OpenSSL provides a hash digest and the algorithm is blocked by security
policy.

Signed-off-by: Christian Heimes <christian@python.org>
5 years agobpo-35714: Reject null characters in struct format strings (GH-16928)
Zackery Spytz [Mon, 25 May 2020 07:55:09 +0000 (01:55 -0600)] 
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.

5 years agobpo-38580: Document that select() accepts iterables, not just sequences (GH-16832)
Jakub Stasiak [Mon, 25 May 2020 07:03:48 +0000 (09:03 +0200)] 
bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832)

5 years agobpo-40334: Support suppressing of multiple optional variables in Pegen (GH-20367)
Batuhan Taskaya [Sun, 24 May 2020 22:20:18 +0000 (01:20 +0300)] 
bpo-40334: Support suppressing of multiple optional variables in Pegen (GH-20367)

5 years agobpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)
Rémi Lapeyre [Sun, 24 May 2020 21:12:57 +0000 (23:12 +0200)] 
bpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)

5 years agobpo-17050: Remove documentation on argparse.REMAINDER (GH-18661)
Albert [Sun, 24 May 2020 18:57:40 +0000 (20:57 +0200)] 
bpo-17050: Remove documentation on argparse.REMAINDER (GH-18661)

Closes [Issue 17050]() by removing argparse.REMAINDER from the documentation, as discussed on the issue.

Automerge-Triggered-By: @rhettinger
5 years agobpo-40443: Remove unused imports in the zoneinfo (GH-20354)
Dong-hee Na [Sun, 24 May 2020 14:37:08 +0000 (23:37 +0900)] 
bpo-40443: Remove unused imports in the zoneinfo (GH-20354)

5 years agobpo-37309: Update IDLE NEWS.txt (GH-20356)
Terry Jan Reedy [Sun, 24 May 2020 13:57:55 +0000 (09:57 -0400)] 
bpo-37309: Update IDLE NEWS.txt (GH-20356)

5 years agobpo-40723: Make IDLE autocomplete test run without __main__.__file__ (GH-20311)
Florian Dahlitz [Sun, 24 May 2020 10:53:44 +0000 (12:53 +0200)] 
bpo-40723: Make IDLE autocomplete test run without __main__.__file__ (GH-20311)

This was the only failure running unittest.main(test.test_idle) after imports.

5 years agobpo-37973: Improve the docstrings of sys.float_info (GH-19218)
Zackery Spytz [Sun, 24 May 2020 10:03:52 +0000 (04:03 -0600)] 
bpo-37973: Improve the docstrings of sys.float_info (GH-19218)

Taken from https://docs.python.org/3/library/sys.html#sys.float_info

5 years agoRemove spurious NULL in descrobject.c (GH-20344)
Hai Shi [Sun, 24 May 2020 05:03:50 +0000 (13:03 +0800)] 
Remove spurious NULL in descrobject.c (GH-20344)

Co-authored-by: hai shi <shihai1991@126.com>
5 years agoUse Py_ssize_t for the column number in the PEG support code (GH-20341)
Pablo Galindo [Sun, 24 May 2020 05:01:34 +0000 (06:01 +0100)] 
Use Py_ssize_t for the column number in the PEG support code (GH-20341)