]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-34215: Clarify IncompleteReadError message when "expected" is None (GH-21925)
Zackery Spytz [Sat, 28 Nov 2020 14:27:28 +0000 (07:27 -0700)] 
bpo-34215: Clarify IncompleteReadError message when "expected" is None (GH-21925)

Co-Authored-By: Tyler Bell <mrbell321@gmail.com>
4 years agobpo-41241: Unnecessary Type casting in 'if condition' (GH-21396)
Wansoo Kim [Sat, 28 Nov 2020 11:37:08 +0000 (20:37 +0900)] 
bpo-41241: Unnecessary Type casting in 'if condition' (GH-21396)

This is my first issue!
So, if there's anything wrong, please tell me!

Also, thank you always for all the contributors!

Automerge-Triggered-By: GH:asvetlov
4 years agobpo-42392: Remove loop parameter from asyncio.tasks and asyncio.subprocess (GH-23521)
Yurii Karabas [Sat, 28 Nov 2020 08:21:17 +0000 (10:21 +0200)] 
bpo-42392: Remove loop parameter from asyncio.tasks and asyncio.subprocess (GH-23521)

4 years agobpo-42452: Improve colorsys.rgb_to_hls code (GH-23306)
Julien Jerphanion [Sat, 28 Nov 2020 07:11:19 +0000 (07:11 +0000)] 
bpo-42452: Improve colorsys.rgb_to_hls code (GH-23306)

Cache repeated sum and difference to make code slightly faster and easier to read.

4 years agobpo-42474: test TracebackException comparison to non-equal instances (GH-23522)
Irit Katriel [Fri, 27 Nov 2020 16:38:54 +0000 (16:38 +0000)] 
bpo-42474: test TracebackException comparison to non-equal instances (GH-23522)

Closes bpo-42474

4 years agobpo-41818: Make test_openpty() avoid unexpected success due to number of rows and...
Soumendra Ganguly [Fri, 27 Nov 2020 10:16:41 +0000 (04:16 -0600)] 
bpo-41818: Make test_openpty() avoid unexpected success due to number of rows and/or number of columns being == 0. (GH-23526)

4 years ago bpo-17852: Doc: Fix the tutorial about closing files (GH-23135)
Volker-Weissmann [Fri, 27 Nov 2020 00:41:32 +0000 (01:41 +0100)] 
 bpo-17852: Doc: Fix the tutorial about closing files (GH-23135)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
4 years agoDocument optional 'task'/'asyncgen' fields in call_exception_handler (#21735)
Shane Harvey [Thu, 26 Nov 2020 13:24:48 +0000 (05:24 -0800)] 
Document optional 'task'/'asyncgen' fields in call_exception_handler (#21735)

4 years agobpo-41332: Added missing connect_accepted_socket() to AbstractEventLoop (GH-21533)
Alex Grönholm [Thu, 26 Nov 2020 10:09:12 +0000 (12:09 +0200)] 
bpo-41332: Added missing connect_accepted_socket() to AbstractEventLoop (GH-21533)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
4 years agobpo-42392: Remove loop parameter from asyncio.streams (GH-23517)
Yurii Karabas [Thu, 26 Nov 2020 07:36:37 +0000 (09:36 +0200)] 
bpo-42392: Remove loop parameter from asyncio.streams (GH-23517)

4 years agobpo-41818: test_openpty succeed on Gentoo, don't expect to fail on this platform...
Andrew Svetlov [Wed, 25 Nov 2020 17:06:12 +0000 (19:06 +0200)] 
bpo-41818: test_openpty succeed on Gentoo, don't expect to fail on this platform (GH-23514)

4 years agoTypo: fix inverted sense of statement (GH-23288)
basak [Wed, 25 Nov 2020 14:12:17 +0000 (14:12 +0000)] 
Typo: fix inverted sense of statement (GH-23288)

Looks like a "not" was inadvertently omitted in commit e6a7ea4.
Classmethods are useful when data stored in specific instances are *not*
needed.

Automerge-Triggered-By: GH:JulienPalard
4 years agobpo-41818: Updated tests for the standard pty library (GH-22962)
Soumendra Ganguly [Wed, 25 Nov 2020 13:41:25 +0000 (07:41 -0600)] 
bpo-41818: Updated tests for the standard pty library (GH-22962)

4 years agobpo-42299: Remove formatter module (GH-23476)
Dong-hee Na [Wed, 25 Nov 2020 13:17:30 +0000 (22:17 +0900)] 
bpo-42299: Remove formatter module (GH-23476)

4 years agobpo-42392: Improve removal of *loop* parameter in asyncio primitives (GH-23499)
Yurii Karabas [Wed, 25 Nov 2020 11:50:44 +0000 (13:50 +0200)] 
bpo-42392: Improve removal of *loop* parameter in asyncio primitives (GH-23499)

* Update code after merge review from 1st1

* Use a sentinel approach for loop parameter
Remove unnecessary _get_running_loop patching

* Use more clear function name (_verify_parameter_is_marker -> _verify_no_loop)

* Add init method to _LoopBoundMixin to check that loop param wasn't used

4 years agobpo-42202: Store func annotations as a tuple (GH-23316)
Yurii Karabas [Wed, 25 Nov 2020 10:43:18 +0000 (12:43 +0200)] 
bpo-42202: Store func annotations as a tuple (GH-23316)

Reduce memory footprint and improve performance of loading modules having many func annotations.

  >>> sys.getsizeof({"a":"int","b":"int","return":"int"})
  232
  >>> sys.getsizeof(("a","int","b","int","return","int"))
  88

The tuple is converted into dict on the fly when `func.__annotations__` is accessed first.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
4 years agoAdd more tests to the descriptor howto guide (GH-23506)
Raymond Hettinger [Wed, 25 Nov 2020 09:54:24 +0000 (01:54 -0800)] 
Add more tests to the descriptor howto guide (GH-23506)

4 years agobpo-12800: tarfile: Restore fix from 011525ee9 (GH-21409)
Julien Palard [Wed, 25 Nov 2020 09:23:17 +0000 (10:23 +0100)] 
bpo-12800: tarfile: Restore fix from 011525ee9 (GH-21409)

Restore fix from 011525ee92eb1c13ad1a62d28725a840e28f8160.

4 years agobpo-42238: Doc: Remove make suspicious from the CI and docs builds. (GH-23313)
Julien Palard [Wed, 25 Nov 2020 09:18:00 +0000 (10:18 +0100)] 
bpo-42238: Doc: Remove make suspicious from the CI and docs builds. (GH-23313)

It probably helped a lot a while back, but may not be as usefull
today.  We'll continue monitoring it before deletion, so true
positives can be migrated to rstlint.

4 years agoDoc: Minor fixes (GH-23422)
kj [Wed, 25 Nov 2020 04:59:59 +0000 (11:59 +0700)] 
Doc: Minor fixes (GH-23422)

4 years agoAdd doctests to the descriptor HowTo (GH-23500)
Raymond Hettinger [Wed, 25 Nov 2020 04:57:02 +0000 (20:57 -0800)] 
Add doctests to the descriptor HowTo (GH-23500)

4 years agobpo-40170: Hide impl detail of Py_TRASHCAN_BEGIN macro (GH-23235)
Hai Shi [Tue, 24 Nov 2020 22:03:31 +0000 (06:03 +0800)] 
bpo-40170: Hide impl detail of Py_TRASHCAN_BEGIN macro (GH-23235)

The Py_TRASHCAN_BEGIN macro no longer accesses PyTypeObject attributes,
but now can get the condition by calling the new private
_PyTrash_cond() function which hides implementation details.

4 years agobpo-42392: Remove loop parameter form asyncio locks and Queue (#23420)
Yurii Karabas [Tue, 24 Nov 2020 18:08:54 +0000 (20:08 +0200)] 
bpo-42392: Remove loop parameter form asyncio locks and Queue (#23420)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
4 years agobpo-42370: Check element before making mouse click in ttk tests (GH-23491)
Serhiy Storchaka [Tue, 24 Nov 2020 17:35:39 +0000 (19:35 +0200)] 
bpo-42370: Check element before making mouse click in ttk tests (GH-23491)

4 years agobpo-42212: smelly.py also checks the dynamic library (GH-23423)
Victor Stinner [Tue, 24 Nov 2020 12:38:08 +0000 (13:38 +0100)] 
bpo-42212: smelly.py also checks the dynamic library (GH-23423)

The smelly.py script now also checks the Python dynamic library and
extension modules, not only the Python static library. Make also the
script more verbose: explain what it does.

The GitHub Action job now builds Python with the libpython dynamic
library.

4 years agobpo-42260: Improve error handling in _PyConfig_FromDict (GH-23488)
Serhiy Storchaka [Tue, 24 Nov 2020 12:07:32 +0000 (14:07 +0200)] 
bpo-42260: Improve error handling in _PyConfig_FromDict (GH-23488)

4 years agobpo-41100: in test_platform, ignore 10.16 (GH-23485)
Ned Deily [Tue, 24 Nov 2020 06:20:35 +0000 (01:20 -0500)] 
bpo-41100: in test_platform, ignore 10.16 (GH-23485)

4 years agobpo-41100: minor build installer fixes (GH-23480)
Ned Deily [Tue, 24 Nov 2020 00:04:40 +0000 (19:04 -0500)] 
bpo-41100: minor build installer fixes (GH-23480)

4 years agoTypo (#23482)
Jesús Cea [Mon, 23 Nov 2020 23:56:30 +0000 (00:56 +0100)] 
Typo (#23482)

4 years agoAdded support for negative indexes to PurePath.parents (GH-21799)
Yaroslav Pankovych [Mon, 23 Nov 2020 20:06:22 +0000 (22:06 +0200)] 
Added support for negative indexes to PurePath.parents (GH-21799)

This commit also fixes up some of the overlapping documentation changed
in bpo-35498, which added support for indexing with slices.

Fixes bpo-21041.
https://bugs.python.org/issue21041

Co-authored-by: Paul Ganssle <p.ganssle@gmail.com>
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
4 years agoDescriptor HowTo: Improve the fidelity of the member object simulation (GH-23475)
Raymond Hettinger [Mon, 23 Nov 2020 18:56:59 +0000 (10:56 -0800)] 
Descriptor HowTo: Improve the fidelity of the member object simulation (GH-23475)

4 years agobpo-15450: Allow subclassing of dircmp (GH-23424) (#23424)
Nick Crews [Mon, 23 Nov 2020 16:29:37 +0000 (09:29 -0700)] 
bpo-15450: Allow subclassing of dircmp (GH-23424) (#23424)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
4 years agobpo-28850: Fix PrettyPrinter.format overrides ignored for contents of small container...
Irit Katriel [Mon, 23 Nov 2020 13:31:31 +0000 (13:31 +0000)] 
bpo-28850: Fix PrettyPrinter.format overrides ignored for contents of small containers (GH-22120)

4 years agobpo-42328: Fix tkinter.ttk.Style.map(). (GH-23300)
Serhiy Storchaka [Sun, 22 Nov 2020 20:48:52 +0000 (22:48 +0200)] 
bpo-42328: Fix tkinter.ttk.Style.map(). (GH-23300)

The function accepts now the representation of the default state as
empty sequence (as returned by Style.map()).
The structure of the result is now the same on all platform
and does not depend on the value of wantobjects.

4 years agobpo-42435: Speed up comparison of bytes and bytearray object (GH--23461)
Serhiy Storchaka [Sun, 22 Nov 2020 20:00:53 +0000 (22:00 +0200)] 
bpo-42435: Speed up comparison of bytes and bytearray object (GH--23461)

* Speed up comparison of bytes objects with non-bytes objects when
  option -b is specified.
* Speed up comparison of bytarray objects with non-buffer object.

4 years agoDoc: fix typo in typing.Type docs (GH-23460)
John Belmonte [Sun, 22 Nov 2020 14:54:19 +0000 (23:54 +0900)] 
Doc: fix typo in typing.Type docs (GH-23460)

4 years agobpo-42423: Accept single base class in PyType_FromModuleAndSpec() (GH-23441)
Serhiy Storchaka [Sun, 22 Nov 2020 11:25:02 +0000 (13:25 +0200)] 
bpo-42423: Accept single base class in PyType_FromModuleAndSpec() (GH-23441)

4 years agobpo-42427: Use the errno attribute of OSError instead of args[0] (GH-23449)
Serhiy Storchaka [Sun, 22 Nov 2020 08:28:34 +0000 (10:28 +0200)] 
bpo-42427: Use the errno attribute of OSError instead of args[0] (GH-23449)

4 years agobpo-42391: Clarify documentation of TestCase.assertIs (GH-23348)
Ram Rachum [Sun, 22 Nov 2020 05:59:48 +0000 (07:59 +0200)] 
bpo-42391: Clarify documentation of TestCase.assertIs (GH-23348)

Removing 'evaluate' makes it more consistent with other assertX entries.

4 years agobpo-41116: Ensure system supplied libraries are found on macOS 11 (GH-23301)
Ronald Oussoren [Sun, 22 Nov 2020 05:14:25 +0000 (06:14 +0100)] 
bpo-41116: Ensure system supplied libraries are found on macOS 11 (GH-23301)

On macOS system provided libraries are in a shared library cache
and not at their usual location. This PR teaches distutils to search
in the SDK, even if there was no "-sysroot" argument in
the compiler flags.

4 years agobpo-42426: IDLE: Fix reporting offset of the RE error in searchengine (GH-23447)
Serhiy Storchaka [Sun, 22 Nov 2020 05:06:51 +0000 (07:06 +0200)] 
bpo-42426: IDLE: Fix reporting offset of the RE error in searchengine (GH-23447)

4 years agobpo-41100: Stripping '-arch arm64' didn't work after all (GH-23280)
Ronald Oussoren [Sun, 22 Nov 2020 02:17:18 +0000 (03:17 +0100)] 
bpo-41100: Stripping '-arch arm64' didn't work after all (GH-23280)

4 years agobpo-42361: Use Tcl/Tk 8.6.10 when building the installer on recent macOS (GH-23293)
Ronald Oussoren [Sun, 22 Nov 2020 02:05:34 +0000 (03:05 +0100)] 
bpo-42361: Use Tcl/Tk 8.6.10 when building the installer on recent macOS (GH-23293)

Building on older versions, and in particular macOS 10.9 still use
Tk 8.6.8 because of build problems on that version of macOS.

4 years agobpo-38443: Check that the specified universal architectures work (GH-22910)
Ronald Oussoren [Sun, 22 Nov 2020 01:13:11 +0000 (02:13 +0100)] 
bpo-38443: Check that the specified universal architectures work (GH-22910)

As [bpo-38443]() says the error message from configure when specifying --enable-universalsdk with a set of architectures that is not supported by the compiler is not very helpful.   This PR explicitly checks if the compiler works and bails out if it doesn't.

4 years agoClarify that Set._from_iterable is not required to be a classmethod. (GH-23272)
Richard Levasseur [Sat, 21 Nov 2020 19:56:24 +0000 (11:56 -0800)] 
Clarify that Set._from_iterable is not required to be a classmethod. (GH-23272)

4 years agobpo-1635741: Port select module to multiphase init (GH-23409)
Christian Heimes [Sat, 21 Nov 2020 19:29:26 +0000 (20:29 +0100)] 
bpo-1635741: Port select module to multiphase init (GH-23409)

4 years agobpo-1635741: Port _posixsubprocess module to multiphase init (GH-23406)
Christian Heimes [Sat, 21 Nov 2020 19:28:14 +0000 (20:28 +0100)] 
bpo-1635741: Port _posixsubprocess module to multiphase init (GH-23406)

4 years agobpo-42425: Fix possible leak in initialization of errmap for OSError (GH-23446)
Serhiy Storchaka [Sat, 21 Nov 2020 17:17:46 +0000 (19:17 +0200)] 
bpo-42425: Fix possible leak in initialization of errmap for OSError (GH-23446)

4 years agobpo-42232: mmap module add Darwin specific madvise options. (GH-23076)
David CARLIER [Sat, 21 Nov 2020 11:39:56 +0000 (11:39 +0000)] 
bpo-42232: mmap module add Darwin specific madvise options. (GH-23076)

4 years agobpo-42412: Fix possible leaks and check arguments in PyType_FromModuleAndSpec() ...
Serhiy Storchaka [Sat, 21 Nov 2020 10:02:53 +0000 (12:02 +0200)] 
bpo-42412: Fix possible leaks and check arguments in PyType_FromModuleAndSpec() (GH-23410)

* There were leaks if Py_tp_bases is used more than once or if some call is
  failed before setting tp_bases.
* There was a crash if the bases argument or the Py_tp_bases slot is not a tuple.
* The documentation was not accurate.

4 years agobpo-40550: Fix time-of-check/time-of-action issue in subprocess.Popen.send_signal...
Filipe Laíns [Sat, 21 Nov 2020 09:22:08 +0000 (09:22 +0000)] 
bpo-40550: Fix time-of-check/time-of-action issue in subprocess.Popen.send_signal. (GH-20010)

send_signal() now swallows the exception if the process it thought was still alive winds up not to exist anymore (always a plausible race condition despite the checks).

Co-authored-by: Gregory P. Smith <greg@krypto.org>
4 years agobpo-40791: Make compare_digest more constant-time. (GH-20444)
Devin Jeanpierre [Sat, 21 Nov 2020 08:55:23 +0000 (01:55 -0700)] 
bpo-40791: Make compare_digest more constant-time. (GH-20444)

* bpo-40791: Make compare_digest more constant-time.

The existing volatile `left`/`right` pointers guarantee that the reads will all occur, but does not guarantee that they will be _used_. So a compiler can still short-circuit the loop, saving e.g. the overhead of doing the xors and especially the overhead of the data dependency between `result` and the reads. That would change performance depending on where the first unequal byte occurs. This change removes that optimization.

(This is change #1 from https://bugs.python.org/issue40791 .)

4 years agobpo-42419: Correct 'deprecatations' is What's New 3.9 (GH-23421)
Quentin Hibon [Sat, 21 Nov 2020 04:07:22 +0000 (05:07 +0100)] 
bpo-42419: Correct 'deprecatations' is What's New 3.9 (GH-23421)

4 years agobpo-42407: Use possessive appostrophe in multiprocessing doc (GH-23400)
ArioA [Sat, 21 Nov 2020 02:37:54 +0000 (02:37 +0000)] 
bpo-42407: Use possessive appostrophe in multiprocessing doc (GH-23400)

4 years agobpo-36876: [c-analyzer tool] Tighten up the results and output. (GH-23431)
Eric Snow [Fri, 20 Nov 2020 22:39:28 +0000 (15:39 -0700)] 
bpo-36876: [c-analyzer tool] Tighten up the results and output. (GH-23431)

We also update the "ignored" file with a temporary list of all known globals.

4 years agobpo-28002: Roundtrip f-strings with ast.unparse better (#19612)
Shantanu [Fri, 20 Nov 2020 21:16:42 +0000 (13:16 -0800)] 
bpo-28002: Roundtrip f-strings with ast.unparse better (#19612)

By attempting to avoid backslashes in f-string expressions.
We also now proactively raise errors for some backslashes we can't
avoid while unparsing FormattedValues

Co-authored-by: hauntsaninja <>
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
4 years agobpo-42360: Add advice to help avoid pickling issues. (GH-23305)
Raymond Hettinger [Fri, 20 Nov 2020 20:49:32 +0000 (12:49 -0800)] 
bpo-42360: Add advice to help avoid pickling issues. (GH-23305)

4 years agoFix wrong availability for signal.SIGCHLD (#23285)
Zhang Maiyun [Fri, 20 Nov 2020 18:16:46 +0000 (02:16 +0800)] 
Fix wrong availability for signal.SIGCHLD (#23285)

I believe this is a mistake. SIGCHLD is only available on Unix systems, not Windows.

4 years agobpo-35498: Added slice support to PathLib parents attribute. (GH-11165)
Joshua Cannon [Fri, 20 Nov 2020 15:40:39 +0000 (09:40 -0600)] 
bpo-35498: Added slice support to PathLib parents attribute. (GH-11165)

Added slice support to the `pathlib.Path.parents` sequence. For a `Path` `p`, slices of `p.parents` should return the same thing as slices of `tuple(p.parents)`.

4 years agobpo-42212: Check if generated files are up-to-date in GitHub Actions (GH-23042)
Filipe Laíns [Fri, 20 Nov 2020 14:14:16 +0000 (14:14 +0000)] 
bpo-42212: Check if generated files are up-to-date in GitHub Actions (GH-23042)

See https: //github.com/python/core-workflow/issues/380

Signed-off-by: Filipe Laíns <lains@archlinux.org>
4 years agobpo-42403: Use @staticmethod in importlib (GH-23395)
Victor Stinner [Fri, 20 Nov 2020 13:44:02 +0000 (14:44 +0100)] 
bpo-42403: Use @staticmethod in importlib (GH-23395)

Use @staticmethod on methods using @classmethod but don't use their
cls parameter on the following classes:

* BuiltinImporter
* FrozenImporter
* WindowsRegistryFinder
* PathFinder

Leave methods using @_requires_builtin or @_requires_frozen unchanged,
since this decorator requires the wrapped method to have an extra parameter
(cls or self).

4 years agobpo-1635741: Convert _sre types to heap types and establish module state (PEP 384...
Erlend Egeberg Aasland [Fri, 20 Nov 2020 12:36:23 +0000 (13:36 +0100)] 
bpo-1635741: Convert _sre types to heap types and establish module state (PEP 384) (GH-23393)

4 years agobpo-1635741: Enhance _datetime error handling (GH-23139)
Mohamed Koubaa [Fri, 20 Nov 2020 10:39:40 +0000 (04:39 -0600)] 
bpo-1635741: Enhance _datetime error handling (GH-23139)

4 years agobpo-42333: Port _ssl extension module to heap types (GH-23392)
Christian Heimes [Fri, 20 Nov 2020 08:40:12 +0000 (09:40 +0100)] 
bpo-42333: Port _ssl extension module to heap types (GH-23392)

All types in _ssl module are now heap types.

4 years agobpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)
Christian Heimes [Fri, 20 Nov 2020 08:26:07 +0000 (09:26 +0100)] 
bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-42416: Use inspect.getdoc for IDLE calltips (GH-23416)
Terry Jan Reedy [Fri, 20 Nov 2020 06:59:11 +0000 (01:59 -0500)] 
bpo-42416: Use inspect.getdoc for IDLE calltips (GH-23416)

Inspect.getdoc(ob) sometimes gets docstrings when ob.__doc__ is None.

4 years agobpo-42345: Add whatsnew and versionchanged for typing.Literal in 3.9 (GH-23386)
kj [Thu, 19 Nov 2020 17:37:26 +0000 (00:37 +0700)] 
bpo-42345: Add whatsnew and versionchanged for typing.Literal in 3.9 (GH-23386)

* Whatsnew entry in 3.9 same as the one in 3.10.
* versionchanged for typing.Literal docs

Needs backport to 3.9.

4 years agobpo-42345: Fix hash implementation of typing.Literal (GH-23383)
Yurii Karabas [Thu, 19 Nov 2020 16:17:38 +0000 (18:17 +0200)] 
bpo-42345: Fix hash implementation of typing.Literal (GH-23383)

Fix hash implementation of `typing.Literal`.

Update docs regarding `typing.Litaral` caching.

Base implementation was done in PR #23294.

4 years agobpo-1635741: Port _posixshmem extension module to multiphase initialization (GH-23404)
Christian Heimes [Thu, 19 Nov 2020 15:20:42 +0000 (16:20 +0100)] 
bpo-1635741: Port _posixshmem extension module to multiphase initialization (GH-23404)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-1635741: Fix _struct for build bot error (GH-23402)
Dong-hee Na [Thu, 19 Nov 2020 14:14:34 +0000 (23:14 +0900)] 
bpo-1635741: Fix _struct for build bot error (GH-23402)

Automerge-Triggered-By: GH:tiran
4 years agobpo-1635741: Port gc module to multiphase initialization (GH-23377)
Christian Heimes [Thu, 19 Nov 2020 14:08:34 +0000 (15:08 +0100)] 
bpo-1635741: Port gc module to multiphase initialization (GH-23377)

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: GH:tiran
4 years agobpo-1635741: Port _struct to multiphase initialization (GH-23398)
Christian Heimes [Thu, 19 Nov 2020 13:36:23 +0000 (14:36 +0100)] 
bpo-1635741: Port _struct to multiphase initialization (GH-23398)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-42403: Simplify importlib external bootstrap (GH-23397)
Victor Stinner [Thu, 19 Nov 2020 12:43:43 +0000 (13:43 +0100)] 
bpo-42403: Simplify importlib external bootstrap (GH-23397)

Simplify the importlib external bootstrap code:
importlib._bootstrap_external now uses regular imports to import
builtin modules. When it is imported, the builtin __import__()
function is already fully working and so can be used to import
builtin modules like sys.

4 years agobpo-42403: Fix pyflakes warnings in importlib (GH-23396)
Victor Stinner [Thu, 19 Nov 2020 10:20:57 +0000 (11:20 +0100)] 
bpo-42403: Fix pyflakes warnings in importlib (GH-23396)

Remove unused imports and unused local variables.

4 years agobpo-1635741: Port spwd to multiphase initialization (GH-23390)
Christian Heimes [Thu, 19 Nov 2020 09:54:03 +0000 (10:54 +0100)] 
bpo-1635741: Port spwd to multiphase initialization (GH-23390)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-1635741: Port _queue to multiphase initialization (GH-23376)
Christian Heimes [Thu, 19 Nov 2020 08:24:37 +0000 (09:24 +0100)] 
bpo-1635741: Port _queue to multiphase initialization (GH-23376)

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: GH:tiran
4 years agobpo-1635741: Port grp and pwd to multiphase initialization (GH-23360)
Christian Heimes [Thu, 19 Nov 2020 07:47:32 +0000 (08:47 +0100)] 
bpo-1635741: Port grp and pwd to multiphase initialization (GH-23360)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-1635741: Port _random to multiphase initialization (GH-23359)
Christian Heimes [Thu, 19 Nov 2020 07:46:29 +0000 (08:46 +0100)] 
bpo-1635741: Port _random to multiphase initialization (GH-23359)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-42375: subprocess DragonFlyBSD build update. (GH-23320)
David CARLIER [Thu, 19 Nov 2020 07:24:15 +0000 (07:24 +0000)] 
bpo-42375: subprocess DragonFlyBSD build update. (GH-23320)

Same as FreeBSD, file descriptors in /dev/fd id from 0 to 63.

4 years agobpo-42345: Add whatsnew for typing.Literal in 3.10 (GH-23385)
kj [Thu, 19 Nov 2020 04:44:24 +0000 (11:44 +0700)] 
bpo-42345: Add whatsnew for typing.Literal in 3.10 (GH-23385)

4 years agobpo-42381: Document walrus-related syntax changes in whatsnew (GH-23382)
Lysandros Nikolaou [Wed, 18 Nov 2020 23:49:28 +0000 (01:49 +0200)] 
bpo-42381: Document walrus-related syntax changes in whatsnew (GH-23382)

Automerge-Triggered-By: GH:lysnikolaou
4 years agobpo-1635741: Port _warnings to the multi-phase init (GH-23379)
Victor Stinner [Wed, 18 Nov 2020 23:19:06 +0000 (00:19 +0100)] 
bpo-1635741: Port _warnings to the multi-phase init (GH-23379)

Port the _warnings extension module to the multi-phase initialization
API (PEP 489).

4 years ago[doc] Fix smtplib and xml.dom.minidom mark-up (GH-22769)
Andre Delfino [Wed, 18 Nov 2020 22:45:17 +0000 (19:45 -0300)] 
[doc] Fix smtplib and xml.dom.minidom mark-up (GH-22769)

4 years agobpo-1635741: Convert _imp to multi-phase init (GH-23378)
Victor Stinner [Wed, 18 Nov 2020 22:18:29 +0000 (23:18 +0100)] 
bpo-1635741: Convert _imp to multi-phase init (GH-23378)

Convert the _imp extension module to the multi-phase initialization
API (PEP 489).

* Add _PyImport_BootstrapImp() which fix a bootstrap issue: import
  the _imp module before importlib is initialized.
* Add create_builtin() sub-function, used by _imp_create_builtin().
* Initialize PyInterpreterState.import_func earlier, in
  pycore_init_builtins().
* Remove references to _PyImport_Cleanup(). This function has been
  renamed to finalize_modules() and moved to pylifecycle.c.

4 years agobpo-39573: Remove What's new entry for Py_SIZE() (GH-23375)
Miro Hrončok [Wed, 18 Nov 2020 21:39:03 +0000 (22:39 +0100)] 
bpo-39573: Remove What's new entry for Py_SIZE() (GH-23375)

A follow up for 0e2ac21dd4960574e89561243763eabba685296a

4 years agobpo-42085: Add documentation for Py_TPFLAGS_HAVE_AM_SEND (GH-23374)
Vladimir Matveev [Wed, 18 Nov 2020 18:58:38 +0000 (10:58 -0800)] 
bpo-42085: Add documentation for Py_TPFLAGS_HAVE_AM_SEND (GH-23374)

Updated docs to include `Py_TPFLAGS_HAVE_AM_SEND`. News section should not be necessary.

Automerge-Triggered-By: GH:asvetlov
4 years agobpo-39573: Convert Py_TYPE() and Py_SIZE() back to macros (GH-23366)
Victor Stinner [Wed, 18 Nov 2020 17:48:06 +0000 (18:48 +0100)] 
bpo-39573: Convert Py_TYPE() and Py_SIZE() back to macros (GH-23366)

This change partically reverts
commit ad3252bad905d41635bcbb4b76db30d570cf0087
and the commit fe2978b3b940fe2478335e3a2ca5ad22338cdf9c.

Many third party C extension modules rely on the ability of using
Py_TYPE() to set an object type: "Py_TYPE(obj) = type;" or to set an
object type using: "Py_SIZE(obj) = size;".

4 years agobpo-42336: Improve PCbuild batch files (GH-23275)
Steve Dower [Wed, 18 Nov 2020 17:24:36 +0000 (17:24 +0000)] 
bpo-42336: Improve PCbuild batch files (GH-23275)

4 years agobpo-40998: Address compiler warnings found by ubsan (GH-20929)
Christian Heimes [Wed, 18 Nov 2020 15:38:53 +0000 (16:38 +0100)] 
bpo-40998: Address compiler warnings found by ubsan (GH-20929)

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: GH:tiran
4 years agobpo-1635741: Port _hashlib to multiphase initialization (GH-23358)
Christian Heimes [Wed, 18 Nov 2020 15:12:13 +0000 (16:12 +0100)] 
bpo-1635741: Port _hashlib to multiphase initialization (GH-23358)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-1635741: Port symtable module to multiphase initialization (GH-23361)
Christian Heimes [Wed, 18 Nov 2020 15:03:51 +0000 (16:03 +0100)] 
bpo-1635741: Port symtable module to multiphase initialization (GH-23361)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-40998: Fix a refleak in create_filter() (GH-23365)
Victor Stinner [Wed, 18 Nov 2020 14:57:10 +0000 (15:57 +0100)] 
bpo-40998: Fix a refleak in create_filter() (GH-23365)

4 years agobpo-42398: Fix "make regen-all" race condition (GH-23362)
Victor Stinner [Wed, 18 Nov 2020 14:36:27 +0000 (15:36 +0100)] 
bpo-42398: Fix "make regen-all" race condition (GH-23362)

Fix a race condition in "make regen-all" when make -jN option is used
to run jobs in parallel. The clinic.py script now only use atomic
write to write files. Moveover, generated files are now left
unchanged if the content does not change, to not change the file
modification time.

The "make regen-all" command runs "make clinic" and "make
regen-importlib" targets:

* "make regen-importlib" builds object files (ex: Modules/_weakref.o)
  from source files (ex: Modules/_weakref.c) and clinic files (ex:
  Modules/clinic/_weakref.c.h)
* "make clinic" always rewrites all clinic files
  (ex: Modules/clinic/_weakref.c.h)

Since there is no dependency between "clinic" and "regen-importlib"
Makefile targets, these two targets can be run in parallel. Moreover,
half of clinic.py file writes are not atomic and so there is a race
condition when "make regen-all" runs jobs in parallel using make -jN
option (which can be passed in MAKEFLAGS environment variable).

Fix clinic.py to make all file writes atomic:

* Add write_file() function to ensure that all file writes are
  atomic: write into a temporary file and then use os.replace().
* Moreover, write_file() doesn't recreate or modify the file if the
  content does not change to avoid modifying the file modification
  file.
* Update test_clinic to verify these assertions with a functional
  test.
* Remove Clinic.force attribute which was no longer used, whereas
  Clinic.verify remains useful.

4 years agobpo-41561: skip test_min_max_version_mismatch (GH-22308)
Christian Heimes [Wed, 18 Nov 2020 12:10:53 +0000 (13:10 +0100)] 
bpo-41561: skip test_min_max_version_mismatch (GH-22308)

skip test_min_max_version_mismatch when TLS 1.0 is not available

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-40656: Clean up detect_socket() (GH-20148)
Erlend Egeberg Aasland [Wed, 18 Nov 2020 00:08:58 +0000 (01:08 +0100)] 
bpo-40656: Clean up detect_socket() (GH-20148)

4 years agobpo-42395: Add aclosing to __all__ (GH-23356)
Tom Gringauz [Tue, 17 Nov 2020 23:18:05 +0000 (01:18 +0200)] 
bpo-42395: Add aclosing to __all__ (GH-23356)

Automerge-Triggered-By: GH:asvetlov
4 years agobpo-42396: Add a whatsnew entry about async contextlib.nullcontext (GH-23357)
Tom Gringauz [Tue, 17 Nov 2020 22:58:35 +0000 (00:58 +0200)] 
bpo-42396: Add a whatsnew entry about async contextlib.nullcontext (GH-23357)

Automerge-Triggered-By: GH:asvetlov
4 years agobpo-41713: Port _signal module to multi-phase init (GH-23355)
Victor Stinner [Tue, 17 Nov 2020 22:28:25 +0000 (23:28 +0100)] 
bpo-41713: Port _signal module to multi-phase init (GH-23355)

Port the _signal extension module to the multi-phase initialization
API (PEP 489).

Co-Authored-By: Mohamed Koubaa <koubaa.m@gmail.com>
4 years agobpo-41625: Skip os.splice() tests on AIX (GH-23354)
Victor Stinner [Tue, 17 Nov 2020 22:08:10 +0000 (23:08 +0100)] 
bpo-41625: Skip os.splice() tests on AIX (GH-23354)

On AIX, splice() only works with a socket, whereas the test uses a
pipe.

4 years agobpo-41686: Move _Py_RestoreSignals() to signalmodule.c (GH-23353)
Victor Stinner [Tue, 17 Nov 2020 21:55:30 +0000 (22:55 +0100)] 
bpo-41686: Move _Py_RestoreSignals() to signalmodule.c (GH-23353)