]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agodict: Internal cleanup (GH-31641)
Inada Naoki [Wed, 2 Mar 2022 10:05:12 +0000 (19:05 +0900)] 
dict: Internal cleanup (GH-31641)

* Make empty_key from split table to combined table.
* Use unicode_get_hash() when possible.

3 years agobpo-46195: Do not add `Optional` in `get_type_hints` (GH-30304)
Nikita Sobolev [Wed, 2 Mar 2022 05:29:46 +0000 (08:29 +0300)] 
bpo-46195: Do not add `Optional` in `get_type_hints` (GH-30304)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-46848: Use stringlib/fastsearch in mmap (GH-31625)
Dennis Sweeney [Wed, 2 Mar 2022 04:46:30 +0000 (23:46 -0500)] 
bpo-46848: Use stringlib/fastsearch in mmap (GH-31625)

Speed up mmap.find(). Add _PyBytes_Find() and _PyBytes_ReverseFind().

3 years agobpo-46845: Reduce dict size when all keys are Unicode (GH-31564)
Inada Naoki [Tue, 1 Mar 2022 23:09:28 +0000 (08:09 +0900)] 
bpo-46845: Reduce dict size when all keys are Unicode (GH-31564)

3 years agobpo-46712: Let generate_global_objects.py Run on Earlier Python Versions (gh-31637)
Eric Snow [Tue, 1 Mar 2022 21:29:54 +0000 (14:29 -0700)] 
bpo-46712: Let generate_global_objects.py Run on Earlier Python Versions (gh-31637)

https://bugs.python.org/issue46712

3 years agobpo-46841: Use inline cache for `BINARY_SUBSCR`. (GH-31618)
Mark Shannon [Tue, 1 Mar 2022 16:00:34 +0000 (16:00 +0000)] 
bpo-46841: Use inline cache for `BINARY_SUBSCR`. (GH-31618)

3 years agobpo-46541: remove usage of _Py_IDENTIFIER from _ssl module (GH-31599)
Kumar Aditya [Tue, 1 Mar 2022 15:38:21 +0000 (21:08 +0530)] 
bpo-46541: remove usage of _Py_IDENTIFIER from _ssl module (GH-31599)

3 years agobpo-46633: Skip tests on ASAN and/or MSAN builds (GH-31632)
Victor Stinner [Tue, 1 Mar 2022 14:44:08 +0000 (15:44 +0100)] 
bpo-46633: Skip tests on ASAN and/or MSAN builds (GH-31632)

Skip tests on ASAN and/or MSAN builds:

* multiprocessing tests
* test___all__
* test_concurrent_futures
* test_decimal
* test_peg_generator
* test_tools

The ASAN job of GitHub Actions no longer excludes these tests.

3 years agobpo-46541: Remove usage of _Py_IDENTIFIER from multibytecodec (GH-31475)
Dong-hee Na [Tue, 1 Mar 2022 14:35:43 +0000 (23:35 +0900)] 
bpo-46541: Remove usage of _Py_IDENTIFIER from multibytecodec (GH-31475)

3 years agobpo-46311: Clean up PyLong_FromLong and PyLong_FromLongLong (GH-30496)
Mark Dickinson [Tue, 1 Mar 2022 14:20:52 +0000 (14:20 +0000)] 
bpo-46311: Clean up PyLong_FromLong and PyLong_FromLongLong (GH-30496)

3 years agobpo-46841: Use inline caching for `COMPARE_OP` (GH-31622)
Brandt Bucher [Tue, 1 Mar 2022 13:53:13 +0000 (05:53 -0800)] 
bpo-46841: Use inline caching for `COMPARE_OP` (GH-31622)

3 years agocompiler: Merge except_table and cnotab (GH-31614)
Inada Naoki [Tue, 1 Mar 2022 01:27:20 +0000 (10:27 +0900)] 
compiler: Merge except_table and cnotab (GH-31614)

3 years agoAdd missing "to" to two tp_flags notes (GH-31624)
Brandt Bucher [Tue, 1 Mar 2022 01:20:14 +0000 (17:20 -0800)] 
Add missing "to" to two tp_flags notes (GH-31624)

3 years agobpo-46771: Remove two controversial lines from Task.cancel() (GH-31623)
Guido van Rossum [Mon, 28 Feb 2022 23:15:56 +0000 (15:15 -0800)] 
bpo-46771: Remove two controversial lines from Task.cancel() (GH-31623)

Also from the _asyncio C accelerator module,
and adjust one test that the change caused to fail.

For more discussion see the discussion starting here:
https://github.com/python/cpython/pull/31394#issuecomment-1053545331

(Basically, @asvetlov proposed to return False from cancel()
when there is already a pending cancellation, and I went along,
even though it wasn't necessary for the task group implementation,
and @agronholm has come up with a counterexample that fails
because of this change.  So now I'm changing it back to the old
semantics (but still bumping the counter) until we can have a
proper discussion about this.)

3 years agobpo-46753: Add the empty tuple to the _PyRuntimeState.global_objects. (gh-31345)
Eric Snow [Mon, 28 Feb 2022 22:15:48 +0000 (15:15 -0700)] 
bpo-46753: Add the empty tuple to the _PyRuntimeState.global_objects. (gh-31345)

https://bugs.python.org/issue46753

3 years agoStatistics internals: Make fewer calls to _coerce() when data types are mixed (GH...
Raymond Hettinger [Mon, 28 Feb 2022 17:43:52 +0000 (11:43 -0600)] 
Statistics internals: Make fewer calls to _coerce() when data types are mixed (GH-31619)

3 years agobpo-45431: Rename CFrame to _PyCFrame in the C API (GH-31584)
Victor Stinner [Mon, 28 Feb 2022 15:03:57 +0000 (16:03 +0100)] 
bpo-45431: Rename CFrame to _PyCFrame in the C API (GH-31584)

Rename also struct _cframe to struct _PyCFrame.

Add a comment suggesting using public functions rather than using
directly the private _PyCFrame structure.

3 years agobpo-46841: Move the cache for `LOAD_GLOBAL` inline. (GH-31575)
Mark Shannon [Mon, 28 Feb 2022 12:56:29 +0000 (12:56 +0000)] 
bpo-46841: Move the cache for `LOAD_GLOBAL` inline. (GH-31575)

3 years agobpo-46567: Add Tcl/Tk build for Windows ARM64 (GH-31574)
Steve Dower [Mon, 28 Feb 2022 12:06:43 +0000 (12:06 +0000)] 
bpo-46567: Add Tcl/Tk build for Windows ARM64 (GH-31574)

3 years agobpo-46841: Use inline caching for `UNPACK_SEQUENCE` (GH-31591)
Brandt Bucher [Mon, 28 Feb 2022 11:54:14 +0000 (03:54 -0800)] 
bpo-46841: Use inline caching for `UNPACK_SEQUENCE` (GH-31591)

3 years agobpo-46541: Remove unneeded visits from sqlite3 (GH-31609)
Erlend Egeberg Aasland [Mon, 28 Feb 2022 09:07:40 +0000 (10:07 +0100)] 
bpo-46541: Remove unneeded visits from sqlite3 (GH-31609)

3 years agobpo-46541: Remove unnecessary Py_VISIT (GH-31608)
Dong-hee Na [Mon, 28 Feb 2022 07:06:58 +0000 (16:06 +0900)] 
bpo-46541: Remove unnecessary Py_VISIT (GH-31608)

3 years agobpo-46786: Make ElementTree write the HTML tags embed, source, track, wbr as empty...
Jannis Vajen [Sun, 27 Feb 2022 14:25:54 +0000 (15:25 +0100)] 
bpo-46786: Make ElementTree write the HTML tags embed, source, track, wbr as empty tags (GH-31406)

See https://html.spec.whatwg.org/multipage/syntax.html#void-elements
for reference.

3 years agobpo-46852: Restore test_getformat() test (GH-31601)
Victor Stinner [Sun, 27 Feb 2022 00:12:33 +0000 (01:12 +0100)] 
bpo-46852: Restore test_getformat() test (GH-31601)

3 years agobpo-46857: Fix refleak in OSError INIT_ALIAS() (GH-31594)
Victor Stinner [Sat, 26 Feb 2022 23:28:24 +0000 (00:28 +0100)] 
bpo-46857: Fix refleak in OSError INIT_ALIAS() (GH-31594)

_Py_GetRefTotal() no longer decrements _PySet_Dummy refcount.

3 years agobpo-46748: Fix ctypes test_frozentable() (GH-31600)
Kumar Aditya [Sat, 26 Feb 2022 23:25:46 +0000 (04:55 +0530)] 
bpo-46748: Fix ctypes test_frozentable() (GH-31600)

3 years agobpo-46606: os.getgroups() doesn't overallocate (GH-31569)
Victor Stinner [Sat, 26 Feb 2022 23:14:28 +0000 (00:14 +0100)] 
bpo-46606: os.getgroups() doesn't overallocate (GH-31569)

3 years ago[doc] Add a note in howto/logging.rst about "do not log to root logger in libraries...
Yuxin Wu [Sat, 26 Feb 2022 18:29:51 +0000 (10:29 -0800)] 
[doc] Add a note in howto/logging.rst about "do not log to root logger in libraries" (GH-31271)

3 years agoPropagate errors (however unlikely) from _Py_Deepfreeze_Init() (GH-31596)
Kumar Aditya [Sat, 26 Feb 2022 16:35:03 +0000 (22:05 +0530)] 
Propagate errors (however unlikely) from _Py_Deepfreeze_Init() (GH-31596)

3 years agoTaskgroup tweaks (GH-31559)
Tin Tvrtković [Sat, 26 Feb 2022 16:18:48 +0000 (17:18 +0100)] 
Taskgroup tweaks (GH-31559)

Now uses .cancel()/.uncancel(), for even fewer broken edge cases.

3 years agobpo-44011: Document ssl_shutdown_timeout added by revisited asyncio SSL implementatio...
Kumar Aditya [Sat, 26 Feb 2022 13:06:43 +0000 (18:36 +0530)] 
bpo-44011: Document ssl_shutdown_timeout added by revisited asyncio SSL implementation  (GH-31597)

3 years agobpo-38415: Remove redundant AsyncContextDecorator.__call__ override from _AsyncGenera...
Thomas Grainger [Sat, 26 Feb 2022 12:05:20 +0000 (12:05 +0000)] 
bpo-38415: Remove redundant AsyncContextDecorator.__call__ override from _AsyncGeneratorContextManager (GH-30233)

3 years agobpo-45735: Promise the long-time truth that `args=list` works (GH-30982)
Charlie Zhao [Sat, 26 Feb 2022 04:17:13 +0000 (12:17 +0800)] 
bpo-45735: Promise the long-time truth that `args=list` works (GH-30982)

For threads, and for multiprocessing, it's always been the case that ``args=list`` works fine when passed to ``Process()`` or ``Thread()``, and such code is common in the wild. But, according to the docs, only a tuple can be used. This brings the docs into synch with reality.

Doc changes by Charlie Zhao.
Co-authored-by: Tim Peters <tim.peters@gmail.com>
3 years agobpo-46852: Remove the float.__set_format__() method (GH-31585)
Victor Stinner [Fri, 25 Feb 2022 23:53:27 +0000 (00:53 +0100)] 
bpo-46852: Remove the float.__set_format__() method (GH-31585)

Remove the undocumented private float.__set_format__() method,
previously known as float.__set_format__() in Python 3.7. Its
docstring said: "You probably don't want to use this function. It
exists mainly to be used in Python's test suite."

3 years agobpo-46816: Remove declarations for non-__STDC__ compilers (GH-31466)
Oleg Iarygin [Fri, 25 Feb 2022 23:16:59 +0000 (02:16 +0300)] 
bpo-46816: Remove declarations for non-__STDC__ compilers (GH-31466)

After Python switched to C11, there is a guarantee that every compiler
conforms to ISO C so checks of __STDC__ have no sense.

3 years agobpo-46712: Share global string identifiers in deepfreeze (GH-31261)
Kumar Aditya [Fri, 25 Feb 2022 18:05:24 +0000 (23:35 +0530)] 
bpo-46712: Share global string identifiers in deepfreeze (GH-31261)

Where appropriate, deepfreeze.c now uses `&_Py_ID(blah)` references instead of locally defining constants. This saves some space.

3 years agobpo-46857: Fix test_embed.test_no_memleak() on Windows (GH-31589)
Victor Stinner [Fri, 25 Feb 2022 17:24:25 +0000 (18:24 +0100)] 
bpo-46857: Fix test_embed.test_no_memleak() on Windows (GH-31589)

Tolerate a leak of 1 reference and 1 memory block until it's fixed.

3 years agobpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)
Kumar Aditya [Fri, 25 Feb 2022 16:41:19 +0000 (22:11 +0530)] 
bpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)

3 years agobpo-46836: Rename InterpreterFrame to _PyInterpreterFrame (GH-31583)
Victor Stinner [Fri, 25 Feb 2022 15:22:00 +0000 (16:22 +0100)] 
bpo-46836: Rename InterpreterFrame to _PyInterpreterFrame (GH-31583)

Rename also struct _interpreter_frame to struct _PyInterpreterFrame.

Reduce risk of name conflicts if a project includes pycore_frame.h.

3 years agobpo-45316: Move _PyArg_Fini() to internal C API (GH-31580)
Victor Stinner [Fri, 25 Feb 2022 15:19:30 +0000 (16:19 +0100)] 
bpo-45316: Move _PyArg_Fini() to internal C API (GH-31580)

Move the private unexported _PyArg_Fini() function to the internal C
API: to the pycore_pylifecycle.h header file.

3 years agobpo-45316: Move private functions to internal C API (GH-31579)
Victor Stinner [Fri, 25 Feb 2022 15:07:14 +0000 (16:07 +0100)] 
bpo-45316: Move private functions to internal C API (GH-31579)

Move the unexported private functions to the internal C API:

* pycore_frame.h: _PyFrame_New_NoTrack()
* pycore_function.h: _PyFunction_GetVersionForCurrentState()
* pycore_genobject.h: _PyAsyncGenValueWrapperNew()
* pycore_genobject.h: _PyCoro_GetAwaitableIter()
* pycore_genobject.h: _PyGen_yf()

3 years agoUpdate dict/OrderedDict differences with code equivalents. (GH-31563)
Raymond Hettinger [Fri, 25 Feb 2022 14:49:53 +0000 (08:49 -0600)] 
Update dict/OrderedDict differences with code equivalents. (GH-31563)

3 years agobpo-45316: Move private PyDict functions to internal C API (GH-31577)
Victor Stinner [Fri, 25 Feb 2022 14:41:55 +0000 (15:41 +0100)] 
bpo-45316: Move private PyDict functions to internal C API (GH-31577)

Move the following private unexported functions to the internal C API
headers:

* _PyDictKeys_GetVersionForCurrentState()
* _PyDictKeys_StringLookup()
* _PyDict_FromKeys()
* _PyDict_GetItemHint()
* _PyDict_KeysSize()
* _PyDict_LoadGlobal()
* _PyDict_NewKeysForClass()
* _PyDict_Pop_KnownHash()
* _PyDict_SetItem_Take2()
* _PyObjectDict_SetItem()
* _PyObject_MakeDictFromInstanceAttributes()
* _Py_dict_lookup()

3 years agobpo-45316: Move private PyCode C API to internal C API (GH-31576)
Victor Stinner [Fri, 25 Feb 2022 14:41:32 +0000 (15:41 +0100)] 
bpo-45316: Move private PyCode C API to internal C API (GH-31576)

Rename private functions (no exported), add an underscore prefix:

* PyLineTable_InitAddressRange() => _PyLineTable_InitAddressRange()
* PyLineTable_NextAddressRange() => _PyLineTable_NextAddressRange()
* PyLineTable_PreviousAddressRange() => _PyLineTable_PreviousAddressRange()

Move private functions to the internal C API:

* _PyCode_Addr2EndLine()
* _PyCode_Addr2EndOffset()
* _PyCode_Addr2Offset()
* _PyCode_InitAddressRange()
* _PyCode_InitEndAddressRange(
* _PyLineTable_InitAddressRange()
* _PyLineTable_NextAddressRange()
* _PyLineTable_PreviousAddressRange()

No longer export the following internal functions:

* _PyCode_GetVarnames()
* _PyCode_GetCellvars()
* _PyCode_GetFreevars()
* _Py_GetSpecializationStats()

Add "extern" to pycore_code.h functions to identify them more easiliy
(they are still not exported).

3 years agobpo-46808: remove NEXT_BLOCK() from compile.c (GH-31448)
Irit Katriel [Fri, 25 Feb 2022 12:17:50 +0000 (12:17 +0000)] 
bpo-46808: remove NEXT_BLOCK() from compile.c (GH-31448)

3 years agobpo-46841: Use *inline* caching for `BINARY_OP` (GH-31543)
Brandt Bucher [Fri, 25 Feb 2022 12:11:34 +0000 (04:11 -0800)] 
bpo-46841: Use *inline* caching for `BINARY_OP` (GH-31543)

3 years agobpo-46836: Move PyFrameObject to pycore_frame.h (GH-31530)
Victor Stinner [Fri, 25 Feb 2022 11:53:19 +0000 (12:53 +0100)] 
bpo-46836: Move PyFrameObject to pycore_frame.h (GH-31530)

Move the PyFrameObject type definition (struct _frame) to the
internal C API pycore_frame.h header file.

3 years agobpo-1635741: Fix winreg reference leaks (GH-31560)
Victor Stinner [Fri, 25 Feb 2022 11:34:00 +0000 (12:34 +0100)] 
bpo-1635741: Fix winreg reference leaks (GH-31560)

Clear also the PyHKEY_Type static type at exit.

3 years agobpo-46756: Fix authorization check in urllib.request (GH-31353)
Serhiy Storchaka [Fri, 25 Feb 2022 11:31:03 +0000 (13:31 +0200)] 
bpo-46756: Fix authorization check in urllib.request (GH-31353)

Fix a bug in urllib.request.HTTPPasswordMgr.find_user_password() and
urllib.request.HTTPPasswordMgrWithPriorAuth.is_authenticated() which
allowed to bypass authorization. For example, access to URI "example.org/foobar"
was allowed if the user was authorized for URI "example.org/foo".

3 years agobpo-34429: Noted TemporaryFile behavior on non-Posix/non-Cygwin systems (GH-31547)
slateny [Fri, 25 Feb 2022 11:07:52 +0000 (03:07 -0800)] 
bpo-34429: Noted TemporaryFile behavior on non-Posix/non-Cygwin systems (GH-31547)

3 years agobpo-46748: Don't import <stdbool.h> in public headers (GH-31553)
Petr Viktorin [Fri, 25 Feb 2022 08:25:54 +0000 (09:25 +0100)] 
bpo-46748: Don't import <stdbool.h> in public headers (GH-31553)

<stdbool.h> is the standard/modern way to define embedd/extends Python free to define bool, true and false, but there are existing applications that use slightly different redefinitions, which fail if the header is included.

It's OK to use stdbool outside the public headers, though.

https://bugs.python.org/issue46748

3 years agobpo-46820: Refactor tests for ambiguous end of numerical literal (GH-31494)
Serhiy Storchaka [Fri, 25 Feb 2022 08:25:12 +0000 (10:25 +0200)] 
bpo-46820: Refactor tests for ambiguous end of numerical literal (GH-31494)

3 years agobpo-46606: Remove redundant +1. (GH-31561)
Inada Naoki [Fri, 25 Feb 2022 05:13:14 +0000 (14:13 +0900)] 
bpo-46606: Remove redundant +1. (GH-31561)

3 years agobpo-46852: Rename float.__set_format__() to float.__setformat__() (GH-31558)
Victor Stinner [Fri, 25 Feb 2022 02:05:25 +0000 (03:05 +0100)] 
bpo-46852: Rename float.__set_format__() to float.__setformat__() (GH-31558)

Rename the private undocumented float.__set_format__() method to
float.__setformat__() to fix a typo introduced in Python 3.7. The
method is only used by test_float.

The change enables again test_float tests on the float format which
were previously skipped because of the typo.

The typo was introduced in Python 3.7 by bpo-20185
in commit b5c51d3dd95bbfde533655fb86ac0f96f771ba7b.

3 years agobpo-46656: Remove Py_NO_NAN macro (GH-31160)
Victor Stinner [Fri, 25 Feb 2022 00:32:57 +0000 (01:32 +0100)] 
bpo-46656: Remove Py_NO_NAN macro (GH-31160)

Building Python now requires support for floating point Not-a-Number
(NaN): remove the Py_NO_NAN macro.

3 years agobpo-46656: Building Python now requires a C11 compiler (GH-31557)
Victor Stinner [Fri, 25 Feb 2022 00:31:30 +0000 (01:31 +0100)] 
bpo-46656: Building Python now requires a C11 compiler (GH-31557)

See PEP 7:
https://python.github.io/peps/pep-0007/#c-dialect

3 years agobpo-46623: Skip two test_zlib tests on s390x (GH-31096)
Victor Stinner [Thu, 24 Feb 2022 23:32:02 +0000 (00:32 +0100)] 
bpo-46623: Skip two test_zlib tests on s390x (GH-31096)

Skip test_pair() and test_speech128() of test_zlib on s390x since
they fail if zlib uses the s390x hardware accelerator.

3 years agobpo-1635741: test_embed cheks that Python does not leak (GH-31555)
Victor Stinner [Thu, 24 Feb 2022 23:03:20 +0000 (00:03 +0100)] 
bpo-1635741: test_embed cheks that Python does not leak (GH-31555)

3 years agobpo-45898: Remove duplicate symbols from _ctypes/cfield.c (GH-29791)
Christian Heimes [Thu, 24 Feb 2022 19:51:57 +0000 (21:51 +0200)] 
bpo-45898: Remove duplicate symbols from _ctypes/cfield.c (GH-29791)

3 years agobpo-45107: Specialize `LOAD_METHOD` for instances with dict. (GH-31531)
Mark Shannon [Thu, 24 Feb 2022 19:34:57 +0000 (19:34 +0000)] 
bpo-45107: Specialize `LOAD_METHOD` for instances with dict. (GH-31531)

3 years agobpo-46430: Fix memory leak in interned strings of deep-frozen modules (GH-31549)
Kumar Aditya [Thu, 24 Feb 2022 16:54:06 +0000 (22:24 +0530)] 
bpo-46430: Fix memory leak in interned strings of deep-frozen modules (GH-31549)

3 years agobpo-45459: C API uses type names rather than structure names (GH-31528)
Victor Stinner [Thu, 24 Feb 2022 16:51:59 +0000 (17:51 +0100)] 
bpo-45459: C API uses type names rather than structure names (GH-31528)

Thanks to the new pytypedefs.h, it becomes to use type names like
PyObject rather like structure names like "struct _object".

3 years agobpo-45459: Add pytypedefs.h header file (GH-31527)
Victor Stinner [Thu, 24 Feb 2022 16:07:12 +0000 (17:07 +0100)] 
bpo-45459: Add pytypedefs.h header file (GH-31527)

Move forward declarations of Python C API types to a new pytypedefs.h
header file to solve interdependency issues between header files.

pytypedefs.h contains forward declarations of the following types:

* PyCodeObject
* PyFrameObject
* PyGetSetDef
* PyInterpreterState
* PyLongObject
* PyMemberDef
* PyMethodDef
* PyModuleDef
* PyObject
* PyThreadState
* PyTypeObject

3 years agobpo-46823: Implement LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE superinstruction (GH-31484)
Dennis Sweeney [Thu, 24 Feb 2022 14:55:59 +0000 (09:55 -0500)] 
bpo-46823: Implement LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE superinstruction (GH-31484)

3 years agobpo-46659: Enhance LocaleTextCalendar for C locale (GH-31214)
Victor Stinner [Thu, 24 Feb 2022 13:29:08 +0000 (14:29 +0100)] 
bpo-46659: Enhance LocaleTextCalendar for C locale (GH-31214)

If the LC_TIME locale is "C", use the user preferred locale.

3 years agoAdd (undocumented) _co_quickened attribute for code object. (GH-31552)
Mark Shannon [Thu, 24 Feb 2022 12:10:53 +0000 (12:10 +0000)] 
Add (undocumented) _co_quickened attribute for code object. (GH-31552)

3 years agobpo-46771: Implement task cancel requests counter (GH-31513)
Tin Tvrtković [Thu, 24 Feb 2022 02:17:00 +0000 (03:17 +0100)] 
bpo-46771: Implement task cancel requests counter (GH-31513)

This changes cancelling() and uncancel() to return the count of pending cancellations.

This can be used to avoid bugs in certain edge cases (e.g. two timeouts going off at the same time).

3 years agobuild(deps): bump actions/upload-artifact from 2.2.4 to 2.3.1 (GH-30325)
dependabot[bot] [Wed, 23 Feb 2022 21:16:47 +0000 (23:16 +0200)] 
build(deps): bump actions/upload-artifact from 2.2.4 to 2.3.1 (GH-30325)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.2.4 to 2.3.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.2.4...v2.3.1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years agobpo-40421: What's New in Python 3.11: PyFrameObject.f_lasti (GH-31536)
Victor Stinner [Wed, 23 Feb 2022 19:20:03 +0000 (20:20 +0100)] 
bpo-40421: What's New in Python 3.11: PyFrameObject.f_lasti (GH-31536)

Suggest replacing PyCode_Addr2Line() with PyFrame_GetLineNumber().

3 years agobpo-44337: Shrink the LOAD_ATTR/STORE_ATTR caches (GH-31517)
Brandt Bucher [Wed, 23 Feb 2022 18:53:24 +0000 (10:53 -0800)] 
bpo-44337: Shrink the LOAD_ATTR/STORE_ATTR caches (GH-31517)

3 years agobpo-40421: Fix PyFrame_GetCode() documentation (GH-31535)
Victor Stinner [Wed, 23 Feb 2022 18:49:21 +0000 (19:49 +0100)] 
bpo-40421: Fix PyFrame_GetCode() documentation (GH-31535)

Fix PyFrame_GetBack() and PyFrame_GetCode() return type in
the documentation.

3 years agocloses bpo-46736: SimpleHTTPRequestHandler now uses HTML5. (GH-31533)
Dong-hee Na [Wed, 23 Feb 2022 17:59:32 +0000 (02:59 +0900)] 
closes bpo-46736: SimpleHTTPRequestHandler now uses HTML5. (GH-31533)

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
3 years agobpo-45412: Add _PY_SHORT_FLOAT_REPR macro (GH-31171)
Victor Stinner [Wed, 23 Feb 2022 17:16:23 +0000 (18:16 +0100)] 
bpo-45412: Add _PY_SHORT_FLOAT_REPR macro (GH-31171)

Remove the HAVE_PY_SET_53BIT_PRECISION macro (moved to the internal
C API).

* Move HAVE_PY_SET_53BIT_PRECISION macro to pycore_pymath.h.
* Replace PY_NO_SHORT_FLOAT_REPR macro with _PY_SHORT_FLOAT_REPR
  macro which is always defined. gcc -Wundef emits a warning when
  using _PY_SHORT_FLOAT_REPR but the macro is not defined, if
  pycore_pymath.h include was forgotten.

3 years agobpo-45885: Don't un-adapt `COMPARE_OP` when collecting stats (GH-31516)
Brandt Bucher [Wed, 23 Feb 2022 11:06:25 +0000 (03:06 -0800)] 
bpo-45885: Don't un-adapt `COMPARE_OP` when collecting stats (GH-31516)

3 years agobpo-46329: Fix test failure when `Py_STATS` is enabled (GH-31511)
Brandt Bucher [Wed, 23 Feb 2022 11:00:28 +0000 (03:00 -0800)] 
bpo-46329: Fix test failure when `Py_STATS` is enabled (GH-31511)

3 years agobpo-46757: Add a test to verify dataclass's __post_init__ isn't being automatically...
Eric V. Smith [Wed, 23 Feb 2022 05:14:35 +0000 (00:14 -0500)] 
bpo-46757: Add a test to verify dataclass's __post_init__ isn't being automatically added. (GH-31523)

3 years agoMinor fixes to C API docs (GH-31501)
Jelle Zijlstra [Wed, 23 Feb 2022 04:34:17 +0000 (20:34 -0800)] 
Minor fixes to C API docs (GH-31501)

* C API docs: move PyErr_SetImportErrorSubclass docs

It was in the section about warnings, but it makes more sense to
put it with PyErr_SetImportError.

* C API docs: document closeit argument to PyRun_AnyFileExFlags

It was already documented for PyRun_SimpleFileExFlags.

* textual fixes to unicode docs

* Move paragraph about tp_dealloc into tp_dealloc section

* __aiter__ returns an async iterator, not an awaitable

3 years agobpo-46794: Bump up the libexpat version into 2.4.6 (GH-31487)
Dong-hee Na [Wed, 23 Feb 2022 01:40:30 +0000 (10:40 +0900)] 
bpo-46794: Bump up the libexpat version into 2.4.6 (GH-31487)

3 years agobpo-46522: fix concurrent.futures and io AttributeError messages (GH-30887)
Thomas Grainger [Wed, 23 Feb 2022 00:25:00 +0000 (00:25 +0000)] 
bpo-46522: fix concurrent.futures and io AttributeError messages (GH-30887)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-46765: Replace Locally Cached Strings with Statically Initialized Objects (gh...
Eric Snow [Wed, 23 Feb 2022 00:23:51 +0000 (17:23 -0700)] 
bpo-46765: Replace Locally Cached Strings with Statically Initialized Objects (gh-31366)

https://bugs.python.org/issue46765

3 years agoInherit asyncio proactor datagram transport from asyncio.DatagramTransport (#31512)
Andrew Svetlov [Tue, 22 Feb 2022 23:39:24 +0000 (01:39 +0200)] 
Inherit asyncio proactor datagram transport from asyncio.DatagramTransport (#31512)

3 years agobpo-45459: Rename buffer.h to pybuffer.h (#31201)
Victor Stinner [Tue, 22 Feb 2022 22:11:48 +0000 (23:11 +0100)] 
bpo-45459: Rename buffer.h to pybuffer.h (#31201)

Rename Include/buffer.h header file to Include/pybuffer.h to avoid
conflicts with projects having an existing "buffer.h" header file.

* Incude pybuffer.h before object.h in Python.h.
* Remove #include "buffer.h" from Include/cpython/object.h.
* Add a forward declaration of the PyObject type in pybuffer.h to fix
  an inter-dependency issue.

3 years agobpo-46659: Deprecate locale.getdefaultlocale() (GH-31206)
Victor Stinner [Tue, 22 Feb 2022 21:06:43 +0000 (22:06 +0100)] 
bpo-46659: Deprecate locale.getdefaultlocale() (GH-31206)

The locale.getdefaultlocale() function is deprecated and will be
removed in Python 3.13. Use locale.setlocale(),
locale.getpreferredencoding(False) and locale.getlocale() functions
instead.

3 years agobpo-46659: Fix the MBCS codec alias on Windows (GH-31218)
Victor Stinner [Tue, 22 Feb 2022 21:04:07 +0000 (22:04 +0100)] 
bpo-46659: Fix the MBCS codec alias on Windows (GH-31218)

3 years agobpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)
Thomas Grainger [Tue, 22 Feb 2022 20:35:57 +0000 (20:35 +0000)] 
bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
3 years agobpo-46729: add number of sub-exceptions in str() of BaseExceptionGroup (GH-31294)
Irit Katriel [Tue, 22 Feb 2022 18:28:58 +0000 (18:28 +0000)] 
bpo-46729: add number of sub-exceptions in str() of BaseExceptionGroup (GH-31294)

3 years agobpo-20923 : [doc] Explain ConfigParser 'valid section name' and .SECTCRE (GH-31413)
vidhya [Tue, 22 Feb 2022 18:06:41 +0000 (13:06 -0500)] 
bpo-20923 : [doc] Explain ConfigParser 'valid section name'  and .SECTCRE (GH-31413)

3 years agobpo-36557: Updated wording for using/windows (GH-31457)
slateny [Tue, 22 Feb 2022 17:36:13 +0000 (09:36 -0800)] 
bpo-36557: Updated wording for using/windows (GH-31457)

3 years agobpo-46725: Document starred expressions in for statements (GH-31481)
Pablo Galindo Salgado [Tue, 22 Feb 2022 17:26:46 +0000 (17:26 +0000)] 
bpo-46725: Document starred expressions in for statements (GH-31481)

Automerge-Triggered-By: GH:pablogsal
3 years agoFix reporting of specialization stats. (GH-31503)
Mark Shannon [Tue, 22 Feb 2022 17:18:10 +0000 (17:18 +0000)] 
Fix reporting of specialization stats. (GH-31503)

3 years agobpo-46822: Increase timeout for test_create_server_ssl_over_ssl to match underlying...
Steve Dower [Tue, 22 Feb 2022 16:25:05 +0000 (16:25 +0000)] 
bpo-46822: Increase timeout for test_create_server_ssl_over_ssl to match underlying timeouts (GH-31502)

3 years agoRemove pair-counts from specialization stats. (GH-31500)
Mark Shannon [Tue, 22 Feb 2022 15:44:31 +0000 (15:44 +0000)] 
Remove pair-counts from specialization stats. (GH-31500)

3 years agoMove call specializations from CALL to PRECALL. (GH-31496)
Mark Shannon [Tue, 22 Feb 2022 14:57:01 +0000 (14:57 +0000)] 
Move call specializations from CALL to PRECALL. (GH-31496)

3 years agodict: Add dk_log2_index_bytes (GH-31439)
Inada Naoki [Tue, 22 Feb 2022 11:03:15 +0000 (20:03 +0900)] 
dict: Add dk_log2_index_bytes (GH-31439)

3 years agobpo-46820: Fix a SyntaxError in a numeric literal followed by "not in" (GH-31479)
Serhiy Storchaka [Tue, 22 Feb 2022 07:51:51 +0000 (09:51 +0200)] 
bpo-46820: Fix a SyntaxError in a numeric literal followed by "not in" (GH-31479)

Fix parsing a numeric literal immediately (without spaces) followed by
"not in" keywords, like in "1not in x". Now the parser only emits
a warning, not a syntax error.

3 years agobpo-46606: Reduce stack usage of getgroups and setgroups (GH-31073)
Inada Naoki [Tue, 22 Feb 2022 02:59:27 +0000 (11:59 +0900)] 
bpo-46606: Reduce stack usage of getgroups and setgroups (GH-31073)

NGROUPS_MAX was 32 before Linux 2.6.4 but 65536 since Linux 2.6.4.

3 years agobpo-45390: Propagate CancelledError's message from cancelled task to its awaiter...
Andrew Svetlov [Mon, 21 Feb 2022 20:59:04 +0000 (22:59 +0200)] 
bpo-45390: Propagate CancelledError's message from cancelled task to its awaiter (GH-31383)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
3 years agobpo-46329: Streamline calling sequence a bit. (GH-31465)
Mark Shannon [Mon, 21 Feb 2022 18:26:47 +0000 (18:26 +0000)] 
bpo-46329: Streamline calling sequence a bit. (GH-31465)

* Move handling of bound-methods to PRECALL.

* Remove call_shape.postcall_shrink

* Remove call_shape.callable

* Remove call_shape.callable. Change CALL oparg to match PRECALL oparg.

* Move KW_NAMES before PRECALL.

* Update opcode docs in dis.rst

3 years agofix __bool__ docstring (GH-31301)
Jelle Zijlstra [Mon, 21 Feb 2022 15:42:27 +0000 (07:42 -0800)] 
fix __bool__ docstring (GH-31301)

3 years agobpo-46811: Make test suite support Expat >=2.4.5 (GH-31453)
Sebastian Pipping [Mon, 21 Feb 2022 14:48:32 +0000 (15:48 +0100)] 
bpo-46811: Make test suite support Expat >=2.4.5 (GH-31453)

Curly brackets were never allowed in namespace URIs
according to RFC 3986, and so-called namespace-validating
XML parsers have the right to reject them a invalid URIs.

libexpat >=2.4.5 has become strcter in that regard due to
related security issues; with ET.XML instantiating a
namespace-aware parser under the hood, this test has no
future in CPython.

References:
- https://datatracker.ietf.org/doc/html/rfc3968
- https://www.w3.org/TR/xml-names/

Also, test_minidom.py: Support Expat >=2.4.5