]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-40241: Add pycore_interp.h header (GH-19499)
Victor Stinner [Mon, 13 Apr 2020 10:47:17 +0000 (12:47 +0200)] 
bpo-40241: Add pycore_interp.h header (GH-19499)

Move PyInterpreterState and related functions to a new internal
pycore_interp.h header file.

5 years agobpo-40268: Add pycore_runtime.h header file (GH-19493)
Victor Stinner [Mon, 13 Apr 2020 09:45:21 +0000 (11:45 +0200)] 
bpo-40268: Add pycore_runtime.h header file (GH-19493)

Move PyRuntimeState from pycore_pystate.h to pycore_runtime.h.

Remove _PyGILState_check_enabled macro: access directly
_PyRuntime.gilstate.check_enabled.

5 years agobpo-40241: Add pycore_gc.h header file (GH-19494)
Victor Stinner [Mon, 13 Apr 2020 09:38:42 +0000 (11:38 +0200)] 
bpo-40241: Add pycore_gc.h header file (GH-19494)

Move the PyGC_Head structure and the following private macros to the
internal C API:

* _PyGCHead_FINALIZED()
* _PyGCHead_NEXT()
* _PyGCHead_PREV()
* _PyGCHead_SET_FINALIZED()
* _PyGCHead_SET_NEXT()
* _PyGCHead_SET_PREV()
* _PyGC_FINALIZED()
* _PyGC_PREV_MASK
* _PyGC_PREV_MASK_COLLECTING
* _PyGC_PREV_MASK_FINALIZED
* _PyGC_PREV_SHIFT
* _PyGC_SET_FINALIZED()
* _PyObject_GC_IS_TRACKED()
* _PyObject_GC_MAY_BE_TRACKED()
* _Py_AS_GC(o)

Keep the private _PyGC_FINALIZED() macro in the public C API for
backward compatibility with Python 3.8: make it an alias to the new
PyObject_GC_IsFinalized() function.

Move the SIZEOF_PYGC_HEAD constant from _testcapi module to
_testinternalcapi module.

5 years agoImproved documentation for `BUILD_CONST_KEY_MAP` (GH-19454)
laike9m [Mon, 13 Apr 2020 02:55:45 +0000 (19:55 -0700)] 
Improved documentation for `BUILD_CONST_KEY_MAP` (GH-19454)

5 years agoAdd double quote cases to invalid prefix tests (GH-19489)
Pablo Galindo [Mon, 13 Apr 2020 01:47:35 +0000 (02:47 +0100)] 
Add double quote cases to invalid prefix tests (GH-19489)

5 years agobpo-40268: Add _PyInterpreterState_GetConfig() (GH-19492)
Victor Stinner [Mon, 13 Apr 2020 01:04:28 +0000 (03:04 +0200)] 
bpo-40268: Add _PyInterpreterState_GetConfig() (GH-19492)

Don't access PyInterpreterState.config member directly anymore, but
use new functions:

* _PyInterpreterState_GetConfig()
* _PyInterpreterState_SetConfig()
* _Py_GetConfig()

5 years agobpo-40234: Revert "bpo-37266: Daemon threads are now denied in subinterpreters (GH...
Victor Stinner [Sun, 12 Apr 2020 21:45:09 +0000 (23:45 +0200)] 
bpo-40234: Revert "bpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)" (GH-19456)

This reverts commit 066e5b1a917ec2134e8997d2cadd815724314252.

5 years agocloses bpo-39953: Generate ifdefs around library code definitions. (GH-19490)
Benjamin Peterson [Sun, 12 Apr 2020 18:59:31 +0000 (13:59 -0500)] 
closes bpo-39953: Generate ifdefs around library code definitions. (GH-19490)

5 years agobpo-40246: Report a better error message for invalid string prefixes (GH-19476)
Lysandros Nikolaou [Sun, 12 Apr 2020 18:21:00 +0000 (21:21 +0300)] 
bpo-40246: Report a better error message for invalid string prefixes (GH-19476)

5 years agobpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object...
Oren Milman [Sun, 12 Apr 2020 14:36:41 +0000 (17:36 +0300)] 
bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997)

5 years agobpo-13743: Add some documentation strings to xml.dom.minidom (GH-16355)
Alex Itkes [Sun, 12 Apr 2020 14:21:58 +0000 (17:21 +0300)] 
bpo-13743: Add some documentation strings to xml.dom.minidom (GH-16355)

5 years agobpo-39011: Preserve line endings within ElementTree attributes (GH-18468)
mefistotelis [Sun, 12 Apr 2020 12:51:58 +0000 (14:51 +0200)] 
bpo-39011: Preserve line endings within ElementTree attributes (GH-18468)

* bpo-39011: Preserve line endings within attributes

Line endings within attributes were previously normalized to "\n" in Py3.7/3.8.
This patch removes that normalization, as line endings which were
replaced by entity numbers should be preserved in original form.

5 years agobpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. (GH-19472)
Serhiy Storchaka [Sun, 12 Apr 2020 11:58:27 +0000 (14:58 +0300)] 
bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. (GH-19472)

5 years agocloses bpo-39953: Update OpenSSL error codes table. (GH-19082)
Benjamin Peterson [Sat, 11 Apr 2020 20:36:12 +0000 (15:36 -0500)] 
closes bpo-39953: Update OpenSSL error codes table. (GH-19082)

I updated the error codes using the OpenSSL 1.1.1f source tree.

5 years agobpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351)
Serhiy Storchaka [Sat, 11 Apr 2020 07:59:24 +0000 (10:59 +0300)] 
bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351)

Patcher's __exit__() is now never called if its __enter__() is failed.
Returning true from __exit__() silences now the exception.

5 years agobpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH...
Serhiy Storchaka [Sat, 11 Apr 2020 07:48:40 +0000 (10:48 +0300)] 
bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345)

5 years agobpo-38501: Add a warning section to multiprocessing.Pool docs about resource managing...
Pablo Galindo [Sat, 11 Apr 2020 02:05:37 +0000 (03:05 +0100)] 
bpo-38501: Add a warning section to multiprocessing.Pool docs about resource managing (GH-19466)

5 years agobpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public C...
Pablo Galindo [Sat, 11 Apr 2020 00:21:54 +0000 (01:21 +0100)] 
bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public C-API (GH-19461)

Add the functions PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public API to allow to query if Python objects are being currently tracked or have been already finalized by the garbage collector respectively.

5 years agobpo-39481: PEP 585 for a variety of modules (GH-19423)
Batuhan Taşkaya [Fri, 10 Apr 2020 14:46:36 +0000 (17:46 +0300)] 
bpo-39481: PEP 585 for a variety of modules (GH-19423)

- concurrent.futures
- ctypes
- http.cookies
- multiprocessing
- queue
- tempfile
- unittest.case
- urllib.parse

5 years agobpo-39481: PEP 585 for difflib, filecmp, fileinput (#19422)
Ethan Smith [Fri, 10 Apr 2020 04:47:31 +0000 (21:47 -0700)] 
bpo-39481: PEP 585 for difflib, filecmp, fileinput (#19422)

5 years agobpo-39481: PEP 585 for enumerate, AsyncGeneratorType, mmap (GH-19421)
Ethan Smith [Fri, 10 Apr 2020 04:25:53 +0000 (21:25 -0700)] 
bpo-39481: PEP 585 for enumerate, AsyncGeneratorType, mmap (GH-19421)

5 years agobpo-39481: PEP 585 for ipaddress.py (GH-19418)
Batuhan Taşkaya [Fri, 10 Apr 2020 04:04:54 +0000 (07:04 +0300)] 
bpo-39481: PEP 585 for ipaddress.py (GH-19418)

5 years agoGeneric itertools.chain (GH-19417)
Ethan Smith [Fri, 10 Apr 2020 03:28:08 +0000 (20:28 -0700)] 
Generic itertools.chain (GH-19417)

5 years agobpo-39943: Keep constness of pointer objects. (19405)
Andy Lester [Fri, 10 Apr 2020 01:05:38 +0000 (20:05 -0500)] 
bpo-39943: Keep constness of pointer objects. (19405)

* Keep constness of pointer objects.

Also moved an auto variable that got consted into its innermost necessary scope.

* move def

Co-authored-by: Benjamin Peterson <benjamin@python.org>
5 years agobpo-31904: Fix test_c_locale_coercion encodings for VxWorks RTOS (GH-19448)
pxinwr [Thu, 9 Apr 2020 15:46:23 +0000 (23:46 +0800)] 
bpo-31904: Fix test_c_locale_coercion encodings for VxWorks RTOS (GH-19448)

5 years agobpo-40077: Remove redundant cast in json module (GH-19438)
Hai Shi [Thu, 9 Apr 2020 15:10:29 +0000 (23:10 +0800)] 
bpo-40077: Remove redundant cast in json module (GH-19438)

5 years agobpo-25780: Expose CAN_RAW_JOIN_FILTERS in the socket module (GH-19190)
Zackery Spytz [Thu, 9 Apr 2020 12:03:49 +0000 (06:03 -0600)] 
bpo-25780: Expose CAN_RAW_JOIN_FILTERS in the socket module (GH-19190)

Co-Authored-By: Stefan Tatschner <stefan@rumpelsepp.org>
5 years agobpo-40082: trip_signal() uses the main interpreter (GH-19441)
Victor Stinner [Wed, 8 Apr 2020 21:35:05 +0000 (23:35 +0200)] 
bpo-40082: trip_signal() uses the main interpreter (GH-19441)

Fix the signal handler: it now always uses the main interpreter,
rather than trying to get the current Python thread state.

The following function now accepts an interpreter, instead of a
Python thread state:

* _PyEval_SignalReceived()
* _Py_ThreadCanHandleSignals()
* _PyEval_AddPendingCall()
* COMPUTE_EVAL_BREAKER()
* SET_GIL_DROP_REQUEST(), RESET_GIL_DROP_REQUEST()
* SIGNAL_PENDING_CALLS(), UNSIGNAL_PENDING_CALLS()
* SIGNAL_PENDING_SIGNALS(), UNSIGNAL_PENDING_SIGNALS()
* SIGNAL_ASYNC_EXC(), UNSIGNAL_ASYNC_EXC()

Py_AddPendingCall() now uses the main interpreter if it fails to the
current Python thread state.

Convert _PyThreadState_GET() and PyInterpreterState_GET_UNSAFE()
macros to static inline functions.

5 years agobpo-37127: Remove _pending_calls.finishing (GH-19439)
Victor Stinner [Wed, 8 Apr 2020 20:10:53 +0000 (22:10 +0200)] 
bpo-37127: Remove _pending_calls.finishing (GH-19439)

5 years agobpo-40226: PyInterpreterState_Delete() deletes pending calls (GH-19436)
Victor Stinner [Wed, 8 Apr 2020 15:54:59 +0000 (17:54 +0200)] 
bpo-40226: PyInterpreterState_Delete() deletes pending calls (GH-19436)

PyInterpreterState_New() is now responsible to create pending calls,
PyInterpreterState_Delete() now deletes pending calls.

* Rename _PyEval_InitThreads() to _PyEval_InitGIL() and rename
  _PyEval_InitGIL() to _PyEval_FiniGIL().
* _PyEval_InitState() and PyEval_FiniState() now create and delete
  pending calls. _PyEval_InitState() now returns -1 on memory
  allocation failure.
* Add init_interp_create_gil() helper function: code shared by
  Py_NewInterpreter() and Py_InitializeFromConfig().
* init_interp_create_gil() now also calls _PyEval_FiniGIL(),
  _PyEval_InitGIL() and _PyGILState_Init() in subinterpreters, but
  these functions now do nothing when called from a subinterpreter.

5 years agoRemove extraneous ')' in abstract.h (GH-19146)
Jimmy Yang [Wed, 8 Apr 2020 09:28:59 +0000 (02:28 -0700)] 
Remove extraneous ')' in abstract.h (GH-19146)

5 years agobpo-40187: Refactor typing.TypedDict. (GH-19372)
Serhiy Storchaka [Wed, 8 Apr 2020 08:03:27 +0000 (11:03 +0300)] 
bpo-40187: Refactor typing.TypedDict. (GH-19372)

5 years agobpo-40185: Refactor typing.NamedTuple (GH-19371)
Serhiy Storchaka [Wed, 8 Apr 2020 07:59:04 +0000 (10:59 +0300)] 
bpo-40185: Refactor typing.NamedTuple (GH-19371)

5 years agobpo-40170: Remove PyIndex_Check() macro (GH-19428)
Victor Stinner [Wed, 8 Apr 2020 00:26:41 +0000 (02:26 +0200)] 
bpo-40170: Remove PyIndex_Check() macro (GH-19428)

Always declare PyIndex_Check() as an opaque function to hide
implementation details: remove PyIndex_Check() macro. The macro
accessed directly the PyTypeObject.tp_as_number member.

5 years agobpo-40170: Add _PyIndex_Check() internal function (GH-19426)
Victor Stinner [Wed, 8 Apr 2020 00:01:56 +0000 (02:01 +0200)] 
bpo-40170: Add _PyIndex_Check() internal function (GH-19426)

Add _PyIndex_Check() function to the internal C API: fast inlined
verson of PyIndex_Check().

Add Include/internal/pycore_abstract.h header file.

Replace PyIndex_Check() with _PyIndex_Check() in C files of Objects
and Python subdirectories.

5 years agobpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)
Victor Stinner [Tue, 7 Apr 2020 23:42:27 +0000 (01:42 +0200)] 
bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)

PyType_HasFeature() now always calls PyType_GetFlags() to hide
implementation details. Previously, it accessed directly the
PyTypeObject.tp_flags member when the limited C API was not used.

Add fast inlined version _PyType_HasFeature() and _PyType_IS_GC()
for object.c and typeobject.c.

5 years agobpo-40170: Convert PyObject_CheckBuffer() macro to a function (GH-19376)
Victor Stinner [Tue, 7 Apr 2020 23:13:53 +0000 (01:13 +0200)] 
bpo-40170: Convert PyObject_CheckBuffer() macro to a function (GH-19376)

Convert PyObject_CheckBuffer() macro to a function to hide
implementation details: the macro accessed directly the
PyTypeObject.tp_as_buffer member.

5 years agobpo-40170: PyObject_NEW() becomes an alias to PyObject_New() (GH-19379)
Victor Stinner [Tue, 7 Apr 2020 22:38:15 +0000 (00:38 +0200)] 
bpo-40170: PyObject_NEW() becomes an alias to PyObject_New() (GH-19379)

The PyObject_NEW() macro becomes an alias to the PyObject_New()
macro, and the PyObject_NEW_VAR() macro becomes an alias to the
PyObject_NewVar() macro, to hide implementation details. They no
longer access directly the PyTypeObject.tp_basicsize member.

Exclude _PyObject_SIZE() and _PyObject_VAR_SIZE() macros from
the limited C API.

Replace PyObject_NEW() with PyObject_New() and replace
PyObject_NEW_VAR() with PyObject_NewVar().

5 years agobpo-39481: Make os.DirEntry generic (GH-19415)
Batuhan Taşkaya [Tue, 7 Apr 2020 21:37:19 +0000 (00:37 +0300)] 
bpo-39481: Make os.DirEntry generic (GH-19415)

5 years agobpo-40089: Add _at_fork_reinit() method to locks (GH-19195)
Victor Stinner [Tue, 7 Apr 2020 21:11:49 +0000 (23:11 +0200)] 
bpo-40089: Add _at_fork_reinit() method to locks (GH-19195)

Add a private _at_fork_reinit() method to _thread.Lock,
_thread.RLock, threading.RLock and threading.Condition classes:
reinitialize the lock after fork in the child process; reset the lock
to the unlocked state.

Rename also the private _reset_internal_locks() method of
threading.Event to _at_fork_reinit().

* Add _PyThread_at_fork_reinit() private function. It is excluded
  from the limited C API.
* threading.Thread._reset_internal_locks() now calls
  _at_fork_reinit() on self._tstate_lock rather than creating a new
  Python lock object.

5 years agobpo-39481: Implementation for PEP 585 (#18239)
Guido van Rossum [Tue, 7 Apr 2020 16:50:06 +0000 (09:50 -0700)] 
bpo-39481: Implementation for PEP 585 (#18239)

This implements things like `list[int]`,
which returns an object of type `types.GenericAlias`.
This object mostly acts as a proxy for `list`,
but has attributes `__origin__` and `__args__`
that allow recovering the parts (with values `list` and `(int,)`.

There is also an approximate notion of type variables;
e.g. `list[T]` has a `__parameters__` attribute equal to `(T,)`.
Type variables are objects of type `typing.TypeVar`.

5 years agobpo-40149: Implement traverse in _abc._abc_data (GH-19412)
Victor Stinner [Tue, 7 Apr 2020 16:36:04 +0000 (18:36 +0200)] 
bpo-40149: Implement traverse in _abc._abc_data (GH-19412)

Implement traverse and clear slots in _abc._abc_data type.

5 years agobpo-37388: Don't check encoding/errors during finalization (GH-19409)
Victor Stinner [Tue, 7 Apr 2020 14:07:42 +0000 (16:07 +0200)] 
bpo-37388: Don't check encoding/errors during finalization (GH-19409)

str.encode() and str.decode() no longer check the encoding and errors
in development mode or in debug mode during Python finalization. The
codecs machinery can no longer work on very late calls to
str.encode() and str.decode().

This change should help to call _PyObject_Dump() to debug during late
Python finalization.

5 years agoDocument missing methods of ssl.SSLObject (#19400)
Rémi Lapeyre [Tue, 7 Apr 2020 07:38:59 +0000 (09:38 +0200)] 
Document missing methods of ssl.SSLObject (#19400)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
5 years agobpo-40214: Temporarily disable a ctypes test (GH-19404)
Zachary Ware [Tue, 7 Apr 2020 06:39:58 +0000 (01:39 -0500)] 
bpo-40214: Temporarily disable a ctypes test (GH-19404)

Only one particular sub-test of
ctypes.test.test_loading.test_load_dll_with_flags is disabled, which
caused failures on Azure Pipelines CI.

5 years agocloses bpo-40166: Change Unicode Howto so that it does not have a specific number...
amaajemyfren [Tue, 7 Apr 2020 04:16:02 +0000 (07:16 +0300)] 
closes bpo-40166: Change Unicode Howto so that it does not have a specific number of assigned code points. (GH-19328)

Change the number of code points from a specific number to a link to the latest standard that has a description of how many code points there are.

5 years agobpo-40196: Fix a bug in the symtable when reporting inspecting global variables ...
Pablo Galindo [Mon, 6 Apr 2020 16:05:57 +0000 (17:05 +0100)] 
bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391)

5 years agobpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377)
Victor Stinner [Mon, 6 Apr 2020 12:07:02 +0000 (14:07 +0200)] 
bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377)

Convert the PyObject_GET_WEAKREFS_LISTPTR() macro to a function to
hide implementation details: the macro accessed directly to the
PyTypeObject.tp_weaklistoffset member.

Add _PyObject_GET_WEAKREFS_LISTPTR() static inline function to the
internal C API.

5 years agobpo-40147: Fix a compiler warning on Windows in Python/compile.c (GH-19389)
Zackery Spytz [Mon, 6 Apr 2020 06:47:47 +0000 (00:47 -0600)] 
bpo-40147: Fix a compiler warning on Windows in Python/compile.c (GH-19389)

Change the type of nkeywords to Py_ssize_t.

5 years agobpo-40197: Better describe the benchmark results table (GH-19386)
Raymond Hettinger [Mon, 6 Apr 2020 01:53:06 +0000 (18:53 -0700)] 
bpo-40197: Better describe the benchmark results table (GH-19386)

5 years agoFix misinformation about NaN != NaN comparison (GH-19357)
Mark Dickinson [Sun, 5 Apr 2020 09:25:24 +0000 (10:25 +0100)] 
Fix misinformation about NaN != NaN comparison (GH-19357)

5 years agobpo-40190: Add support for _SC_AIX_REALMEM in sysconf (GH-19380)
Batuhan Taşkaya [Sun, 5 Apr 2020 00:40:49 +0000 (03:40 +0300)] 
bpo-40190: Add support for _SC_AIX_REALMEM in sysconf (GH-19380)

5 years agobpo-40182: Remove the _field_types attribute of the NamedTuple class (GH-19368)
Serhiy Storchaka [Sat, 4 Apr 2020 21:43:20 +0000 (00:43 +0300)] 
bpo-40182: Remove the _field_types attribute of the NamedTuple class (GH-19368)

5 years agocloses bpo-40184: Only define pysiphash if the hash algorithm is SIPHASH24. (GH-19369)
Batuhan Taşkaya [Sat, 4 Apr 2020 21:25:12 +0000 (00:25 +0300)] 
closes bpo-40184: Only define pysiphash if the hash algorithm is SIPHASH24. (GH-19369)

5 years agobpo-40077: Fix potential refleaks of _json: traverse memo (GH-19344)
Hai Shi [Sat, 4 Apr 2020 19:24:16 +0000 (03:24 +0800)] 
bpo-40077: Fix potential refleaks of _json: traverse memo (GH-19344)

Fix possible refleaks in _json module, memo of PyScannerObject
should be traversed.

5 years agobpo-36517: Raise error on multiple inheritance with NamedTuple (GH-19363)
Serhiy Storchaka [Sat, 4 Apr 2020 18:31:30 +0000 (21:31 +0300)] 
bpo-36517: Raise error on multiple inheritance with NamedTuple (GH-19363)

5 years agoConvert tuples to sets for faster searches (GH-19365)
Raymond Hettinger [Sat, 4 Apr 2020 18:03:04 +0000 (11:03 -0700)] 
Convert tuples to sets for faster searches (GH-19365)

5 years agobpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359)
Steve Dower [Sat, 4 Apr 2020 14:19:08 +0000 (15:19 +0100)] 
bpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359)

5 years agobpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152)
Tal Einat [Sat, 4 Apr 2020 03:05:58 +0000 (06:05 +0300)] 
bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152)

Inspect.signature failed on the test case because its isinstance call raised.

5 years agobpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343)
Chris Martinez [Fri, 3 Apr 2020 20:03:54 +0000 (13:03 -0700)] 
bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343)

Fix default Python home path relative to the NuGet package

5 years agobpo-40141: Include the value in the column position for keyword AST nodes (GH-19348)
Pablo Galindo [Fri, 3 Apr 2020 20:02:26 +0000 (21:02 +0100)] 
bpo-40141: Include the value in the column position for keyword AST nodes (GH-19348)

5 years agobpo-40147: Move the check for duplicate keywords to the compiler (GH-19289)
Pablo Galindo [Fri, 3 Apr 2020 19:37:13 +0000 (20:37 +0100)] 
bpo-40147: Move the check for duplicate keywords to the compiler (GH-19289)

5 years agobpo-40131: Fix source and target order in zipapp example (GH-19290)
Zackery Spytz [Fri, 3 Apr 2020 16:36:29 +0000 (10:36 -0600)] 
bpo-40131: Fix source and target order in zipapp example (GH-19290)

5 years agobpo-40112: distutils test_search_cpp: Fix logic to determine if C compiler is xlc...
Michael Felt [Fri, 3 Apr 2020 14:38:28 +0000 (16:38 +0200)] 
bpo-40112: distutils test_search_cpp: Fix logic to determine if C compiler is xlc on AIX (GH-19225)

5 years agobpo-40122: Updated documentation for dis.findlabels() (GH-19274)
laike9m [Fri, 3 Apr 2020 08:00:28 +0000 (01:00 -0700)] 
bpo-40122: Updated documentation for dis.findlabels() (GH-19274)

5 years agobpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19320)
Victor Stinner [Fri, 3 Apr 2020 01:05:10 +0000 (03:05 +0200)] 
bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19320)

Update also OpenSSL version in Ubuntu and Coverage jobs.

5 years agobpo-40162: Update Travis CI config to OpenSSL 1.1.1f (GH-19319)
Victor Stinner [Fri, 3 Apr 2020 01:03:59 +0000 (03:03 +0200)] 
bpo-40162: Update Travis CI config to OpenSSL 1.1.1f (GH-19319)

5 years agobpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314)
Victor Stinner [Thu, 2 Apr 2020 22:40:25 +0000 (00:40 +0200)] 
bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314)

test_builtin.PtyTests now registers an handler for SIGHUP signal.
Closing the PTY file descriptor can emit a SIGHUP signal: just ignore
it.

run_child() now also closes the PTY file descriptor before waiting
for the process completition, otherwise the test hangs on AIX.

5 years agolib2to3: Support named assignment expressions (GH-12702)
Tim Hatch [Thu, 2 Apr 2020 22:34:54 +0000 (15:34 -0700)] 
lib2to3: Support named assignment expressions (GH-12702)

There are two copies of the grammar -- the one used by Python itself as
Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at
Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it
to be reasonable stable to avoid requiring fixer rewrites.

This brings suport for syntax like `if x:= foo():` to match what the live
Python grammar does.

This should've been added at the time of the walrus operator itself, but lib2to3 being
independent is often overlooked.  So we do consider this a bugfix rather than enhancement.

5 years agobpo-38972: Link to instructions to change PowerShell execution policy (GH-19131)
Derek Keeler [Thu, 2 Apr 2020 19:00:21 +0000 (12:00 -0700)] 
bpo-38972: Link to instructions to change PowerShell execution policy (GH-19131)

5 years agobpo-1635741: Fix refleak in _locale init error handling (GH-19307)
Hai Shi [Thu, 2 Apr 2020 18:00:47 +0000 (02:00 +0800)] 
bpo-1635741: Fix refleak in _locale init error handling (GH-19307)

5 years agobpo-1635741: Port resource extension module to multiphase initialization (PEP 489...
Hai Shi [Thu, 2 Apr 2020 12:35:08 +0000 (20:35 +0800)] 
bpo-1635741: Port resource extension module to multiphase initialization (PEP 489) (GH-19252)

Fix also reference leaks on error.

5 years agobpo-40115: Fix refleak in test_asyncio.test_run_in_executor_cancel() (GH-19282)
Kyle Stanley [Thu, 2 Apr 2020 02:46:44 +0000 (22:46 -0400)] 
bpo-40115: Fix refleak in test_asyncio.test_run_in_executor_cancel() (GH-19282)

Call explicitly self.loop.shutdown_default_executor().

5 years agobpo-40094: Fix which.py script exit code (GH-19286)
Victor Stinner [Thu, 2 Apr 2020 01:42:47 +0000 (03:42 +0200)] 
bpo-40094: Fix which.py script exit code (GH-19286)

It now uses os.waitstatus_to_exitcode() to convert os.system() exit
status into an exit code.

5 years agobpo-40094: CGIHTTPRequestHandler logs exit code (GH-19285)
Victor Stinner [Thu, 2 Apr 2020 01:42:05 +0000 (03:42 +0200)] 
bpo-40094: CGIHTTPRequestHandler logs exit code (GH-19285)

CGIHTTPRequestHandler of http.server now logs the CGI script exit
code, rather than the CGI script exit status of os.waitpid().

For example, if the script is killed by signal 11, it now logs:
"CGI script exit code -11."

5 years agobpo-37207: Use PEP 590 vectorcall to speed up dict() (GH-19280)
Dong-hee Na [Thu, 2 Apr 2020 00:55:43 +0000 (09:55 +0900)] 
bpo-37207: Use PEP 590 vectorcall to speed up dict() (GH-19280)

5 years agobpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288)
Victor Stinner [Thu, 2 Apr 2020 00:53:33 +0000 (02:53 +0200)] 
bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288)

5 years agobpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284)
Victor Stinner [Thu, 2 Apr 2020 00:52:20 +0000 (02:52 +0200)] 
bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284)

The AbstractBasicAuthHandler class of the urllib.request module uses
an inefficient regular expression which can be exploited by an
attacker to cause a denial of service. Fix the regex to prevent the
catastrophic backtracking. Vulnerability reported by Ben Caller
and Matt Schwager.

AbstractBasicAuthHandler of urllib.request now parses all
WWW-Authenticate HTTP headers and accepts multiple challenges per
header: use the realm of the first Basic challenge.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
5 years agobpo-40094: mailcap.test() uses waitstatus_to_exitcode() (GH-19287)
Victor Stinner [Thu, 2 Apr 2020 00:00:06 +0000 (02:00 +0200)] 
bpo-40094: mailcap.test() uses waitstatus_to_exitcode() (GH-19287)

mailcap.test() now uses os.waitstatus_to_exitcode() to convert
os.system() exit status into an exit code.

5 years agobpo-40141: Add line and column information to ast.keyword nodes (GH-19283)
Pablo Galindo [Wed, 1 Apr 2020 23:47:39 +0000 (00:47 +0100)] 
bpo-40141: Add line and column information to ast.keyword nodes (GH-19283)

5 years agobpo-40094: Add os.waitstatus_to_exitcode() (GH-19201)
Victor Stinner [Wed, 1 Apr 2020 16:49:29 +0000 (18:49 +0200)] 
bpo-40094: Add os.waitstatus_to_exitcode() (GH-19201)

Add os.waitstatus_to_exitcode() function to convert a wait status to an
exitcode.

Suggest waitstatus_to_exitcode() usage in the documentation when
appropriate.

Use waitstatus_to_exitcode() in:

* multiprocessing, os, subprocess and _bootsubprocess modules;
* test.support.wait_process();
* setup.py: run_command();
* and many tests.

5 years agobpo-38527: fix configure script for Solaris (GH-16845)
Arnon Yaari [Wed, 1 Apr 2020 15:19:09 +0000 (18:19 +0300)] 
bpo-38527: fix configure script for Solaris (GH-16845)

On Solaris, the regular "grep" command may be an old version that fails to search a binary file. We need to use the correct command (ggrep, in our case), which is found by the configure script earlier.

Automerge-Triggered-By: @pablogsal
5 years agobpo-40071: Fix potential crash in _functoolsmodule.c (GH-19273)
Paulo Henrique Silva [Wed, 1 Apr 2020 15:06:21 +0000 (12:06 -0300)] 
bpo-40071: Fix potential crash in _functoolsmodule.c (GH-19273)

Changes on 7dd549eb0893 made _functools compatible with
PEP-489 and we could have multiple modules instances loaded.

But, right now there is no way to make `kwd_mark` global into
a per module instance variable. kwd_mark is used on lru_cache_new
which does not have a reference to a PyModule*, necessary to use
PyModule_GetState.

PEP-573 will solve this problem and will allow us to move the global
state to per-module data and properly clear the state when unloading
a module instance.

This change temporarily disable cleaning of kwd_mark to avoid NULL
pointer dereference if we clear kwd_mark and other module instances
still alive use it.

5 years agobpo-39682: make `pathlib.Path` immutable by removing (undocumented) support for ...
Barney Gale [Wed, 1 Apr 2020 14:10:51 +0000 (15:10 +0100)] 
bpo-39682: make `pathlib.Path` immutable by removing (undocumented) support for "closing" a path by using it as a context manager (GH-18846)

Support for using a path as a context manager remains, and is now a no-op.

5 years agobpo-33262: Deprecate passing None for `s` to shlex.split() (GH-6514)
Zackery Spytz [Wed, 1 Apr 2020 13:58:55 +0000 (07:58 -0600)] 
bpo-33262: Deprecate passing None for `s` to shlex.split() (GH-6514)

* bpo-33262: Deprecate passing None for `s` to shlex.split()

This reads the string to split from standard input.

* Update What's New.

* Fix shlex.rst

5 years agobpo-40094: Enhance os.WIFEXITED documentation (GH-19244)
Victor Stinner [Wed, 1 Apr 2020 13:48:05 +0000 (15:48 +0200)] 
bpo-40094: Enhance os.WIFEXITED documentation (GH-19244)

5 years agobpo-40130: _PyUnicode_AsKind() should not be exported. (GH-19265)
Serhiy Storchaka [Wed, 1 Apr 2020 12:41:49 +0000 (15:41 +0300)] 
bpo-40130: _PyUnicode_AsKind() should not be exported. (GH-19265)

Make it a static function, and pass known attributes
(kind, data, length) instead of the PyUnicode object.

5 years agobpo-40121: Fix exception type in test (GH-19267)
Steve Dower [Wed, 1 Apr 2020 08:38:26 +0000 (09:38 +0100)] 
bpo-40121: Fix exception type in test (GH-19267)

5 years agoHandle when IOCTL_VM_SOCKETS_GET_LOCAL_CID does not exist in "socket" (GH-19270)
Pablo Galindo [Wed, 1 Apr 2020 00:48:37 +0000 (01:48 +0100)] 
Handle when IOCTL_VM_SOCKETS_GET_LOCAL_CID does not exist in "socket" (GH-19270)

Running `test_socket` or anything that depends on it (like python -m
test.pythoninfo) crashes if IOCTL_VM_SOCKETS_GET_LOCAL_CID does not
exist in the socket module.

Automerge-Triggered-By: @pablogsal
5 years agobpo-40094: Add missing import to wait_process() (GH-19268)
Victor Stinner [Wed, 1 Apr 2020 00:26:19 +0000 (02:26 +0200)] 
bpo-40094: Add missing import to wait_process() (GH-19268)

5 years agobpo-40094: Add run_command() to setup.py (GH-19266)
Victor Stinner [Tue, 31 Mar 2020 23:10:07 +0000 (01:10 +0200)] 
bpo-40094: Add run_command() to setup.py (GH-19266)

5 years agobpo-31160: Fix race condition in test_os.PtyTests (GH-19263)
Victor Stinner [Tue, 31 Mar 2020 22:27:18 +0000 (00:27 +0200)] 
bpo-31160: Fix race condition in test_os.PtyTests (GH-19263)

bpo-31160, bpo-40094: Wait until the process completes before closing
the PTY to prevent sending SIGHUP to the child process.

5 years agobpo-40094: Add _bootsubprocess._waitstatus_to_exitcode (GH-19264)
Victor Stinner [Tue, 31 Mar 2020 21:45:13 +0000 (23:45 +0200)] 
bpo-40094: Add _bootsubprocess._waitstatus_to_exitcode (GH-19264)

* Add _waitstatus_to_exitcode() helper function to _bootsubprocess.
* Enhance check_output() error message if the command fails.

_bootsubprocess no longer handles WIFSTOPPED() case: it now raises a
ValueError.

5 years agobpo-39943: Clean up marshal.c. (GH-19236)
Serhiy Storchaka [Tue, 31 Mar 2020 20:23:21 +0000 (23:23 +0300)] 
bpo-39943: Clean up marshal.c. (GH-19236)

* Add consts.
* Remove redundant casts and checks.
* Use concrete C API macros.
* Avoid raising and silencing OverflowError for ints.

5 years agobpo-40094: Enhance threading tests (GH-19260)
Victor Stinner [Tue, 31 Mar 2020 19:49:44 +0000 (21:49 +0200)] 
bpo-40094: Enhance threading tests (GH-19260)

* Rewrite test_thread.test_forkinthread() to use
  support.wait_process() and wait for the child process in the main
  thread, not in the spawned thread.
* test_threading now uses support.wait_process() and checks the child
  process exit code to detect crashes.

5 years agobpo-40094: Enhance fork and wait tests (GH-19259)
Victor Stinner [Tue, 31 Mar 2020 19:46:40 +0000 (21:46 +0200)] 
bpo-40094: Enhance fork and wait tests (GH-19259)

* test_fork1: remove duplicated wait_impl() method: reuse
  fork_wait.py implementation instead.
* Use exit code different than 0 to ensure that we executed the
  expected code path.

5 years agobpo-40094: Add test.support.wait_process() (GH-19254)
Victor Stinner [Tue, 31 Mar 2020 18:08:12 +0000 (20:08 +0200)] 
bpo-40094: Add test.support.wait_process() (GH-19254)

Moreover, the following tests now check the child process exit code:

* test_os.PtyTests
* test_mailbox.test_lock_conflict()
* test_tempfile.test_process_awareness()
* test_uuid.testIssue8621()
* multiprocessing resource tracker tests

5 years agoDocument most common signals (GH-19245)
Victor Stinner [Tue, 31 Mar 2020 17:13:10 +0000 (19:13 +0200)] 
Document most common signals (GH-19245)

Document individual signals (only the most common signals):
description, default action, availability.

5 years agocloses bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19248)
Benjamin Peterson [Tue, 31 Mar 2020 15:49:56 +0000 (10:49 -0500)] 
closes bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19248)

5 years agobpo-40003: test.bisect_cmd copies Python options (GH-19246)
Victor Stinner [Tue, 31 Mar 2020 15:25:56 +0000 (17:25 +0200)] 
bpo-40003: test.bisect_cmd copies Python options (GH-19246)

test.bisect_cmd now copies Python command line options like -O or -W.
Moreover, emit a warning if test.bisect_cmd is used with
-w/--verbose2 option.