Victor Stinner [Tue, 1 Dec 2020 09:37:39 +0000 (10:37 +0100)]
bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587)
No longer use deprecated aliases to functions:
* Replace PyObject_MALLOC() with PyObject_Malloc()
* Replace PyObject_REALLOC() with PyObject_Realloc()
* Replace PyObject_FREE() with PyObject_Free()
* Replace PyObject_Del() with PyObject_Free()
* Replace PyObject_DEL() with PyObject_Free()
Victor Stinner [Tue, 1 Dec 2020 08:56:42 +0000 (09:56 +0100)]
bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586)
No longer use deprecated aliases to functions:
* Replace PyMem_MALLOC() with PyMem_Malloc()
* Replace PyMem_REALLOC() with PyMem_Realloc()
* Replace PyMem_FREE() with PyMem_Free()
* Replace PyMem_Del() with PyMem_Free()
* Replace PyMem_DEL() with PyMem_Free()
Modify also the PyMem_DEL() macro to use directly PyMem_Free().
restart_subprocess is a method of self, the pyshell.InteractiveInterpreter instance. The latter does not have an interp attribute redundantly referring to itself. (The PyShell instance does have an interp attribute, referring to the InteractiveInterpreter instance.)
pxinwr [Sat, 28 Nov 2020 22:14:16 +0000 (06:14 +0800)]
bpo-31904: remove libnet dependency from detect_socket() for VxWorks (GH-23394)
Previously on VxWorks compiling socket extension module needs the libnet to link. Now VxWorks has moved the replied functions to libc. So removing libnet from setup.py.
Zackery Spytz [Sat, 28 Nov 2020 21:46:30 +0000 (14:46 -0700)]
Fix an error in the news entry for _posixsubprocess multiphase init (GH-23516)
Commit 035deee265c7fb227ddc87222fa48761231d8bd7 converted the
_posixsubprocess module to multiphase initialization, but the news entry
mentions the _posixshmem module.
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.
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.
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.
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.
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.
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.
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.
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.
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>
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 .)
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
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)`.
Leave methods using @_requires_builtin or @_requires_frozen unchanged,
since this decorator requires the wrapped method to have an extra parameter
(cls or self).