]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-102541: Hide traceback in help prompt (gh-102614)
Kirill Podoprigora [Wed, 14 Jun 2023 12:17:12 +0000 (15:17 +0300)] 
gh-102541: Hide traceback in help prompt (gh-102614)

2 years agogdb libpython.py: Remove compatibility code (#105739)
Victor Stinner [Wed, 14 Jun 2023 10:30:22 +0000 (12:30 +0200)] 
gdb libpython.py: Remove compatibility code (#105739)

Remove compatibility code for Python 2 and early Python 3 versions.

* Remove os_fsencode() reimplementation: use os.fsencode() directly.
  os.fsencode() was added to Python 3.2.
* Remove references to Python 2 and "Python 3": just say "Python".
* Remove outdated u'' string format: use '' instead.

2 years agogh-105745: Fix open method of webbrowser.Konqueror (#105746)
Nikita Sobolev [Wed, 14 Jun 2023 10:29:16 +0000 (13:29 +0300)] 
gh-105745: Fix open method of webbrowser.Konqueror (#105746)

2 years agogh-105687: Remove deprecated objects from `re` module (#105688)
Nikita Sobolev [Wed, 14 Jun 2023 10:26:20 +0000 (13:26 +0300)] 
gh-105687: Remove deprecated objects from `re` module (#105688)

2 years ago_ctypes callbacks.c uses _Py_COMP_DIAG_IGNORE_DEPR_DECLS (#105732)
Victor Stinner [Wed, 14 Jun 2023 10:12:25 +0000 (12:12 +0200)] 
_ctypes callbacks.c uses _Py_COMP_DIAG_IGNORE_DEPR_DECLS (#105732)

Replace #pragma with _Py_COMP_DIAG_PUSH,
_Py_COMP_DIAG_IGNORE_DEPR_DECLS and _Py_COMP_DIAG_POP to ease Python
maintenance. Also add a comment explaining why callbacks.c ignores a
deprecation warning.

2 years agotarfile: Fix positional-only syntax in docs (GH-105770)
Jelle Zijlstra [Wed, 14 Jun 2023 07:26:48 +0000 (00:26 -0700)] 
tarfile: Fix positional-only syntax in docs (GH-105770)

The syntax used in the current docs (a / before any args) is invalid.

I think the right approach is for the arguments to arbitrary
filter functions to be treated as positional-only, meaning that users
can supply filter functions with any names for the argument. tarfile.py
only calls the filter function with positional arguments.

2 years agogh-105587: Remove assertion from `_PyStaticObject_CheckRefcnt` (#105638)
Eddie Elizondo [Wed, 14 Jun 2023 04:33:32 +0000 (00:33 -0400)] 
gh-105587: Remove assertion from `_PyStaticObject_CheckRefcnt` (#105638)

2 years agoGH-89812: Clean up pathlib tests. (#104829)
Barney Gale [Wed, 14 Jun 2023 04:06:58 +0000 (05:06 +0100)] 
GH-89812: Clean up pathlib tests. (#104829)

Clean up pathlib tests.

Merge `PurePathTest` into `_BasePurePathTest`, and `PathTest` into
`_BasePathTest`.

2 years agogh-105751: test_ctypes avoids "from ctypes import *" (#105768)
Victor Stinner [Wed, 14 Jun 2023 03:34:11 +0000 (05:34 +0200)] 
gh-105751: test_ctypes avoids "from ctypes import *" (#105768)

Using "import *" prevents linters like pyflakes to detect undefined names
(usually missing imports).

Replace c_voidp with c_void_p.

2 years agogh-105751: test_ctypes.test_numbers uses top level imports (#105762)
Victor Stinner [Wed, 14 Jun 2023 02:47:01 +0000 (04:47 +0200)] 
gh-105751: test_ctypes.test_numbers uses top level imports (#105762)

Moroever, c_ulonglong and c_bool are always available.

2 years agogh-105751: test_ctypes gets Windows attrs from ctypes (#105758)
Victor Stinner [Wed, 14 Jun 2023 02:46:47 +0000 (04:46 +0200)] 
gh-105751: test_ctypes gets Windows attrs from ctypes (#105758)

test_ctypes now gets attributes specific to Windows from the ctypes
module, rather than relying on "from ctypes import *".

Attributes:

* ctypes.FormatError
* ctypes.WINFUNCTYPE
* ctypes.WinError
* ctypes.WinDLL
* ctypes.windll
* ctypes.oledll
* ctypes.get_last_error()
* ctypes.set_last_error()

2 years agogh-105699: Use a Thread-Local Variable for PKGCONTEXT (gh-105740)
Eric Snow [Wed, 14 Jun 2023 00:58:23 +0000 (18:58 -0600)] 
gh-105699: Use a Thread-Local Variable for PKGCONTEXT (gh-105740)

This fixes a race during import. The existing _PyRuntimeState.imports.pkgcontext is shared between interpreters, and occasionally this would cause a crash when multiple interpreters were importing extensions modules at the same time.  To solve this we add a thread-local variable for the value.  We also leave the existing state (and infrequent race) in place for platforms that do not support thread-local variables.

2 years agogh-104812: Skip Pending Calls Tests if No Threading (gh-105761)
Eric Snow [Wed, 14 Jun 2023 00:39:18 +0000 (18:39 -0600)] 
gh-104812: Skip Pending Calls Tests if No Threading (gh-105761)

This fixes the WASM buildbots.

2 years agogh-105387: Limited C API implements Py_INCREF() as func (#105388)
Victor Stinner [Wed, 14 Jun 2023 00:33:00 +0000 (02:33 +0200)] 
gh-105387: Limited C API implements Py_INCREF() as func (#105388)

In the limited C API version 3.12, Py_INCREF() and Py_DECREF()
functions are now implemented as opaque function calls to hide
implementation details.

2 years agoGH-104554: Add RTSPS support to `urllib/parse.py` (#104605)
zentarim [Tue, 13 Jun 2023 23:45:47 +0000 (02:45 +0300)] 
GH-104554: Add RTSPS support to `urllib/parse.py` (#104605)

* GH-104554: Add RTSPS support to `urllib/parse.py`

RTSPS is the permanent scheme defined in
https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
alongside RTSP and RTSPU schemes.

* 📜🤖 Added by blurb_it.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years agogh-105436: Ignore unrelated errors when checking empty env (GH-105742)
Steve Dower [Tue, 13 Jun 2023 23:00:16 +0000 (00:00 +0100)] 
gh-105436: Ignore unrelated errors when checking empty env (GH-105742)

2 years agogh-98040: Fix importbench: use types.ModuleType() (#105743)
Victor Stinner [Tue, 13 Jun 2023 22:32:12 +0000 (00:32 +0200)] 
gh-98040: Fix importbench: use types.ModuleType() (#105743)

Replace removed imp.new_module(name) with types.ModuleType(name).

2 years agogh-104812: Run Pending Calls in any Thread (gh-104813)
Eric Snow [Tue, 13 Jun 2023 21:02:19 +0000 (15:02 -0600)] 
gh-104812: Run Pending Calls in any Thread (gh-104813)

For a while now, pending calls only run in the main thread (in the main interpreter).  This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.

2 years agogh-102613: Bump recursion limit to fix running test_pathlib under Coverage (#105744)
Łukasz Langa [Tue, 13 Jun 2023 20:44:27 +0000 (20:44 +0000)] 
gh-102613: Bump recursion limit to fix running test_pathlib under Coverage (#105744)

2 years agogh-105481: add flags to each instr in the opcode metadata table, to replace opcode...
Irit Katriel [Tue, 13 Jun 2023 20:42:03 +0000 (21:42 +0100)] 
gh-105481: add flags to each instr in the opcode metadata table, to replace opcode.hasarg/hasname/hasconst (#105482)

2 years agogh-105733: Deprecate ctypes SetPointerType() and ARRAY() (#105734)
Victor Stinner [Tue, 13 Jun 2023 18:16:26 +0000 (20:16 +0200)] 
gh-105733: Deprecate ctypes SetPointerType() and ARRAY() (#105734)

2 years agogh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620)
Eric Snow [Tue, 13 Jun 2023 17:08:32 +0000 (11:08 -0600)] 
gh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620)

We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.

2 years agogh-105718: Fix buffer allocation in tokenizer with readline (#105728)
Lysandros Nikolaou [Tue, 13 Jun 2023 15:18:11 +0000 (17:18 +0200)] 
gh-105718: Fix buffer allocation in tokenizer with readline (#105728)

2 years agogh-105373: Remove PyArg_Parse() deprecation (#105394)
Victor Stinner [Tue, 13 Jun 2023 11:49:36 +0000 (13:49 +0200)] 
gh-105373: Remove PyArg_Parse() deprecation (#105394)

There is no plan to deprecate PyArg_Parse().

The deprecation was added as a comment in the C API documentation in
2007 by commit 85eb8c103c9e460917911b43c6be302c30d75efb.

2 years agogh-105713: Document that tokenize raises when mixing tabs/spaces (#105723)
Lysandros Nikolaou [Tue, 13 Jun 2023 10:39:29 +0000 (12:39 +0200)] 
gh-105713: Document that tokenize raises when mixing tabs/spaces (#105723)

* gh-105713: Document that tokenize raises when mixing tabs/spaces
* Update Doc/whatsnew/3.12.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoFix magic number (GH-105722)
Mark Shannon [Tue, 13 Jun 2023 09:34:27 +0000 (10:34 +0100)] 
Fix magic number (GH-105722)

2 years agoGH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE (GH...
Mark Shannon [Tue, 13 Jun 2023 08:51:05 +0000 (09:51 +0100)] 
GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE (GH-105680)

2 years agogh-105375: Improve error handling in _Unpickler_SetInputStream() (#105667)
Erlend E. Aasland [Tue, 13 Jun 2023 08:38:01 +0000 (10:38 +0200)] 
gh-105375: Improve error handling in _Unpickler_SetInputStream() (#105667)

Prevent exceptions from possibly being overwritten in case of multiple
failures.

2 years agoGH-105684: Require `asyncio.Task` implementations to support `set_name` method (...
Kumar Aditya [Tue, 13 Jun 2023 06:06:40 +0000 (11:36 +0530)] 
GH-105684: Require `asyncio.Task` implementations to support `set_name` method (#105685)

2 years agoGH-104787: use bitfields in `_asyncio` (#104788)
Kumar Aditya [Tue, 13 Jun 2023 05:41:34 +0000 (11:11 +0530)] 
GH-104787: use bitfields in `_asyncio` (#104788)

2 years agogh-105540: Fix code generator tests (#105707)
Guido van Rossum [Mon, 12 Jun 2023 21:55:15 +0000 (14:55 -0700)] 
gh-105540: Fix code generator tests (#105707)

This involves expanding PEEK, POKE and JUMPBY macros,
and removing super and register tests (those features no longer exist).

2 years agogh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields (#105686)
Erlend E. Aasland [Mon, 12 Jun 2023 21:35:07 +0000 (23:35 +0200)] 
gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields (#105686)

All fields must be explicitly initialised to prevent manipulation of
uninitialised fields in dealloc.

Align initialisation order with the layout of the object structs.

2 years agogh-105331: Change `asyncio.sleep` to raise ``ValueError` for nan (#105641)
Jay [Mon, 12 Jun 2023 20:29:02 +0000 (04:29 +0800)] 
gh-105331: Change `asyncio.sleep` to raise ``ValueError` for nan (#105641)

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agoRemove support for legacy bytecode instructions (#105705)
Guido van Rossum [Mon, 12 Jun 2023 18:19:04 +0000 (11:19 -0700)] 
Remove support for legacy bytecode instructions (#105705)

(A legacy instruction is of the form `instr(FOOBAR)`,
i.e. missing the `(... -- ...)` stack/cache effect annotation.)

2 years agogh-105229: Remove syntactic support for super-instructions (#105703)
Guido van Rossum [Mon, 12 Jun 2023 17:47:08 +0000 (10:47 -0700)] 
gh-105229: Remove syntactic support for super-instructions (#105703)

It will not be used again.

2 years agogh-105436: The environment block should end with two null wchar_t values (GH-105495)
Dora203 [Mon, 12 Jun 2023 16:14:55 +0000 (00:14 +0800)] 
gh-105436: The environment block should end with two null wchar_t values (GH-105495)

2 years agogh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)
Petr Viktorin [Mon, 12 Jun 2023 15:45:49 +0000 (17:45 +0200)] 
gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)

2 years agoARM64 clamping bug also exists in MSVC 14.35 (GH-105679)
Steve Dower [Mon, 12 Jun 2023 15:09:14 +0000 (16:09 +0100)] 
ARM64 clamping bug also exists in MSVC 14.35 (GH-105679)

2 years agogh-105673: Fix uninitialized warning in sysmodule.c (#105674)
Nikita Sobolev [Mon, 12 Jun 2023 08:47:56 +0000 (11:47 +0300)] 
gh-105673: Fix uninitialized warning in sysmodule.c (#105674)

In sys_add_xoption(), 'value' may be uninitialized for some error paths.

2 years agogh-105481: add pseudo-instructions to the bytecodes DSL (#105506)
Irit Katriel [Sun, 11 Jun 2023 21:31:59 +0000 (22:31 +0100)] 
gh-105481: add pseudo-instructions to the bytecodes DSL (#105506)

2 years agogh-105375: Harden pyexpat initialisation (#105606)
Erlend E. Aasland [Sun, 11 Jun 2023 20:18:46 +0000 (22:18 +0200)] 
gh-105375: Harden pyexpat initialisation (#105606)

Add proper error handling to add_errors_module() to prevent exceptions
from possibly being overwritten.

2 years agogh-105375: Improve error handling in the sys extension module (#105611)
Erlend E. Aasland [Sun, 11 Jun 2023 20:02:49 +0000 (22:02 +0200)] 
gh-105375: Improve error handling in the sys extension module (#105611)

In _PySys_AddXOptionWithError() and sys_add_xoption(),
bail on first error to prevent exceptions from possibly being
overwritten.

2 years agogh-105375: Improve error handling in _ctypes (#105593)
Erlend E. Aasland [Sun, 11 Jun 2023 19:46:19 +0000 (21:46 +0200)] 
gh-105375: Improve error handling in _ctypes (#105593)

Prevent repeated PyLong_FromVoidPtr() from possibly overwriting the
current exception.

2 years agogh-105375: Improve error handling in PyUnicode_BuildEncodingMap() (#105491)
Erlend E. Aasland [Sun, 11 Jun 2023 19:29:19 +0000 (21:29 +0200)] 
gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() (#105491)

Bail on first error to prevent exceptions from possibly being overwritten.

2 years agogh-105375: Improve PyErr_WarnExplicit() error handling (#105610)
Erlend E. Aasland [Sun, 11 Jun 2023 19:23:28 +0000 (21:23 +0200)] 
gh-105375: Improve PyErr_WarnExplicit() error handling (#105610)

Bail on first error to prevent exceptions from possibly being
overwritten.

2 years agobpo-44185: Added close() to mock_open __exit__ (#26902)
Samet YASLAN [Sun, 11 Jun 2023 18:51:21 +0000 (20:51 +0200)] 
bpo-44185: Added close() to mock_open __exit__ (#26902)

2 years agogh-102676: Add more convenience properties to `dis.Instruction` (#103969)
Tomas R [Sun, 11 Jun 2023 15:50:34 +0000 (17:50 +0200)] 
gh-102676: Add more convenience properties to `dis.Instruction` (#103969)

Adds start_offset, cache_offset, end_offset, baseopcode,
baseopname, jump_target and oparg to dis.Instruction.

Also slightly improves the disassembly output by allowing
opnames to overflow into the space reserved for opargs.

2 years agoFix typo in configparser module docstring (#105652)
litlighilit [Sun, 11 Jun 2023 14:06:42 +0000 (22:06 +0800)] 
Fix typo in configparser module docstring (#105652)

"zc.buildbot" -> "zc.buildout"

2 years agogh-105375: Improve error handling in the builtins extension module (#105585)
Erlend E. Aasland [Sun, 11 Jun 2023 10:20:43 +0000 (12:20 +0200)] 
gh-105375: Improve error handling in the builtins extension module (#105585)

2 years agogh-105375: Improve _decimal error handling (#105605)
Erlend E. Aasland [Sun, 11 Jun 2023 10:06:06 +0000 (12:06 +0200)] 
gh-105375: Improve _decimal error handling (#105605)

Fix a bug where an exception could end up being overwritten.

2 years agogh-105375: Harden _datetime initialisation (#105604)
Erlend E. Aasland [Sun, 11 Jun 2023 10:03:09 +0000 (12:03 +0200)] 
gh-105375: Harden _datetime initialisation (#105604)

Improve error handling so init bails on the first exception.

2 years agogh-105375: Improve array.array exception handling (#105594)
Erlend E. Aasland [Sun, 11 Jun 2023 09:58:08 +0000 (11:58 +0200)] 
gh-105375: Improve array.array exception handling (#105594)

Fix a bug where 'tp_richcompare' could end up overwriting an exception.

2 years agogh-105375: Harden _ssl initialisation (#105599)
Erlend E. Aasland [Sun, 11 Jun 2023 09:56:32 +0000 (11:56 +0200)] 
gh-105375: Harden _ssl initialisation (#105599)

Add proper error handling to prevent reference leaks and overwritten
exceptions.

2 years agogh-80480: Emit DeprecationWarning for array's 'u' type code (#95760)
Hugo van Kemenade [Sun, 11 Jun 2023 09:17:35 +0000 (12:17 +0300)] 
gh-80480: Emit DeprecationWarning for array's 'u' type code (#95760)

2 years agogh-99108: Mention HACL\* in the hashlib docs. (#105634)
Gregory P. Smith [Sat, 10 Jun 2023 19:09:20 +0000 (12:09 -0700)] 
gh-99108: Mention HACL\* in the hashlib docs. (#105634)

2 years agoCleanup and clarify our hashlib docs. (#105624)
Gregory P. Smith [Sat, 10 Jun 2023 18:49:06 +0000 (11:49 -0700)] 
Cleanup and clarify our hashlib docs. (#105624)

Clarify and improve our hashlib docs. Now with 50% less mess!

2 years agogh-105375: Harden error handling in `_testcapi/heaptype.c` (#105608)
Erlend E. Aasland [Fri, 9 Jun 2023 21:53:33 +0000 (23:53 +0200)] 
gh-105375: Harden error handling in `_testcapi/heaptype.c` (#105608)

Bail on first error in heapctypesubclasswithfinalizer_finalize()

2 years agogh-105375: Improve error handling in `zoneinfo` module (#105586)
Nikita Sobolev [Fri, 9 Jun 2023 21:48:54 +0000 (00:48 +0300)] 
gh-105375: Improve error handling in `zoneinfo` module (#105586)

Fix bugs where exceptions could end up being overwritten
because of deferred error handling.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agoDocs: fix formatting in 2023-06-09-12-59-18 NEWS item (#105607)
Erlend E. Aasland [Fri, 9 Jun 2023 21:14:02 +0000 (23:14 +0200)] 
Docs: fix formatting in 2023-06-09-12-59-18 NEWS item (#105607)

2 years agogh-105549: Tokenize separately NUMBER and NAME tokens and allow 0-prefixed literals...
Pablo Galindo Salgado [Fri, 9 Jun 2023 20:39:01 +0000 (21:39 +0100)] 
gh-105549: Tokenize separately NUMBER and NAME tokens and allow 0-prefixed literals (#105555)

2 years agogh-105375: Improve error handling in _elementtree (#105591)
Erlend E. Aasland [Fri, 9 Jun 2023 20:35:03 +0000 (22:35 +0200)] 
gh-105375: Improve error handling in _elementtree (#105591)

Fix bugs where exceptions could end up being overwritten.

2 years agogh-105375: Improve posix error handling (#105592)
Erlend E. Aasland [Fri, 9 Jun 2023 20:07:47 +0000 (22:07 +0200)] 
gh-105375: Improve posix error handling (#105592)

Fix a bug where an IndexError could end up being overwritten.

2 years agogh-105375: Improve errnomodule error handling (#105590)
Erlend E. Aasland [Fri, 9 Jun 2023 19:57:25 +0000 (21:57 +0200)] 
gh-105375: Improve errnomodule error handling (#105590)

Bail immediately if an exception is set, to prevent exceptions from
being overwritten.

2 years agogh-105375: Improve _pickle error handling (#105475)
Erlend E. Aasland [Fri, 9 Jun 2023 17:09:53 +0000 (19:09 +0200)] 
gh-105375: Improve _pickle error handling (#105475)

Error handling was deferred in some cases, which could potentially lead
to exceptions being overwritten.

2 years agogh-105375: Improve error handling in compiler_enter_scope() (#105494)
Erlend E. Aasland [Fri, 9 Jun 2023 16:55:53 +0000 (18:55 +0200)] 
gh-105375: Improve error handling in compiler_enter_scope() (#105494)

2 years agogh-105564: Don't include artificial newlines in the line attribute of tokens (#105565)
Pablo Galindo Salgado [Fri, 9 Jun 2023 16:01:26 +0000 (17:01 +0100)] 
gh-105564: Don't include artificial newlines in the line attribute of tokens (#105565)

2 years agoClarify the supported cases in the tokenize module (#105569)
Pablo Galindo Salgado [Fri, 9 Jun 2023 15:59:37 +0000 (16:59 +0100)] 
Clarify the supported cases in the tokenize module (#105569)

2 years agogh-105497: [Enum] Fix Flag inversion when alias/mask members exist. (GH-105542)
Ethan Furman [Fri, 9 Jun 2023 15:56:05 +0000 (08:56 -0700)] 
gh-105497: [Enum] Fix Flag inversion when alias/mask members exist. (GH-105542)

When inverting a Flag member (or boundary STRICT), only consider other canonical flags; when inverting an IntFlag member (or boundary KEEP), also consider aliases.

2 years agoMiscellaneous improvements to the typing docs (#105529)
Alex Waygood [Fri, 9 Jun 2023 15:08:57 +0000 (16:08 +0100)] 
Miscellaneous improvements to the typing docs (#105529)

Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative.

2 years agogh-105557: Remove duplicate sqlite3 test method (#105558)
Erlend E. Aasland [Fri, 9 Jun 2023 13:36:59 +0000 (15:36 +0200)] 
gh-105557: Remove duplicate sqlite3 test method (#105558)

test_func_return_too_large_int() was defined twice.
Keep only the redefined method, as that also checks the tracebacks.

2 years agogh-94924: support `inspect.iscoroutinefunction` in `create_autospec(async_def)` ...
Thomas Grainger [Fri, 9 Jun 2023 13:29:09 +0000 (14:29 +0100)] 
gh-94924: support `inspect.iscoroutinefunction` in `create_autospec(async_def)` (#94962)

* support inspect.iscoroutinefunction in create_autospec(async_def)

* test create_autospec with inspect.iscoroutine and inspect.iscoroutinefunction

* test when create_autospec functions check their signature

2 years agogh-105407: Remove unused imports (#105554)
Victor Stinner [Fri, 9 Jun 2023 12:50:31 +0000 (14:50 +0200)] 
gh-105407: Remove unused imports (#105554)

2 years agogh-102304: Remove Py_INCREF() doc change (#105552)
Victor Stinner [Fri, 9 Jun 2023 09:56:03 +0000 (11:56 +0200)] 
gh-102304: Remove Py_INCREF() doc change (#105552)

Py_INCREF() was made compatible again with Python 3.9 and older in
the limited API of Python debug mode.

2 years agogh-102304: Fix Py_INCREF() for limited C API 3.9 (#105550)
Victor Stinner [Fri, 9 Jun 2023 09:30:41 +0000 (11:30 +0200)] 
gh-102304: Fix Py_INCREF() for limited C API 3.9 (#105550)

When Python is built in debug mode (Py_REF_DEBUG macro), Py_INCREF()
and Py_DECREF() of the limited C API 3.9 (and older) now call
Py_IncRef() and Py_DecRef(), since _Py_IncRef() and _Py_DecRef() were
added to Python 3.10.

2 years agogh-105545: Remove deprecated `MacOSXOSAScript._name` (gh-105546)
Nikita Sobolev [Fri, 9 Jun 2023 08:52:58 +0000 (11:52 +0300)] 
gh-105545: Remove deprecated `MacOSXOSAScript._name` (gh-105546)

2 years agogh-105396: Deprecate PyImport_ImportModuleNoBlock() function (#105397)
Victor Stinner [Fri, 9 Jun 2023 08:30:57 +0000 (10:30 +0200)] 
gh-105396: Deprecate PyImport_ImportModuleNoBlock() function (#105397)

Deprecate the PyImport_ImportModuleNoBlock() function which is just
an alias to PyImport_ImportModule() since Python 3.3.

2 years agoCI: Configure macOS build as per updated devguide recommendations (#105533)
Erlend E. Aasland [Thu, 8 Jun 2023 22:26:03 +0000 (00:26 +0200)] 
CI: Configure macOS build as per updated devguide recommendations (#105533)

2 years agogh-102832: IDLE - update stackviewer open (#105528)
Terry Jan Reedy [Thu, 8 Jun 2023 21:59:55 +0000 (17:59 -0400)] 
gh-102832: IDLE - update stackviewer open (#105528)

Use 'last_exc' instead of 'last_value' in 3.12/3.

2 years agogh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (#103339)
Irit Katriel [Thu, 8 Jun 2023 20:19:05 +0000 (21:19 +0100)] 
gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (#103339)

2 years agogh-100227: Lock Around Modification of the Global Allocators State (gh-105516)
Eric Snow [Thu, 8 Jun 2023 20:06:54 +0000 (14:06 -0600)] 
gh-100227: Lock Around Modification of the Global Allocators State (gh-105516)

The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low.

2 years agogh-105332: [Enum] Fix unpickling flags in edge-cases (GH-105348)
Nikita Sobolev [Thu, 8 Jun 2023 18:40:15 +0000 (21:40 +0300)] 
gh-105332: [Enum] Fix unpickling flags in edge-cases (GH-105348)

* revert enum pickling from by-name to by-value

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2 years agogh-100227: Lock Around Adding Global Audit Hooks (gh-105515)
Eric Snow [Thu, 8 Jun 2023 18:38:15 +0000 (12:38 -0600)] 
gh-100227: Lock Around Adding Global Audit Hooks (gh-105515)

The risk of a race with this state is relatively low, but we play it safe anyway.

2 years agogh-104310: Rename the New Function in importlib.util (gh-105255)
Eric Snow [Thu, 8 Jun 2023 18:19:58 +0000 (12:19 -0600)] 
gh-104310: Rename the New Function in importlib.util (gh-105255)

The original name wasn't as clear as it could have been. This change includes the following:

* rename the function
* change the default value for "disable_check" to False
* add clues to the docstring that folks should probably not use the function

---------

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2 years agogh-100227: Lock Around Use of the Global "atexit" State (gh-105514)
Eric Snow [Thu, 8 Jun 2023 18:08:28 +0000 (12:08 -0600)] 
gh-100227: Lock Around Use of the Global "atexit" State (gh-105514)

The risk of a race with this state is relatively low, but we play it safe anyway.

2 years agoRevert "Move observability-relevant structure fields to the top" (#105512)
Pablo Galindo Salgado [Thu, 8 Jun 2023 15:59:38 +0000 (16:59 +0100)] 
Revert "Move observability-relevant structure fields to the top" (#105512)

2 years agotest_types: Replace raw assert statements (#105500)
Jelle Zijlstra [Thu, 8 Jun 2023 14:46:33 +0000 (07:46 -0700)] 
test_types: Replace raw assert statements (#105500)

2 years agoFurther improve docs for `typing.Annotated` (#105498)
Alex Waygood [Thu, 8 Jun 2023 14:36:30 +0000 (15:36 +0100)] 
Further improve docs for `typing.Annotated` (#105498)

2 years agoGH-105229: Remove remaining two-codeunit superinstructions (GH-105326)
Mark Shannon [Thu, 8 Jun 2023 11:35:34 +0000 (12:35 +0100)] 
GH-105229: Remove remaining two-codeunit superinstructions (GH-105326)

* Remove LOAD_CONST__LOAD_FAST and LOAD_FAST__LOAD_CONST superinstructions.

2 years agoMove observability-relevant structure fields to the top (#105271)
Gabriele N. Tornetta [Thu, 8 Jun 2023 10:41:24 +0000 (11:41 +0100)] 
Move observability-relevant structure fields to the top (#105271)

2 years agogh-105431: Remove unused stuff from `test_typing.NewTypeTests` (#105432)
Nikita Sobolev [Thu, 8 Jun 2023 06:30:42 +0000 (09:30 +0300)] 
gh-105431: Remove unused stuff from `test_typing.NewTypeTests` (#105432)

2 years agogh-104635: Eliminate redundant STORE_FAST instructions in the compiler (gh-105320)
Dong-hee Na [Wed, 7 Jun 2023 23:39:56 +0000 (08:39 +0900)] 
gh-104635: Eliminate redundant STORE_FAST instructions in the compiler (gh-105320)

2 years agoGH-104996: Defer joining of `pathlib.PurePath()` arguments. (GH-104999)
Barney Gale [Wed, 7 Jun 2023 22:27:06 +0000 (23:27 +0100)] 
GH-104996: Defer joining of `pathlib.PurePath()` arguments. (GH-104999)

Joining of arguments is moved to `_load_parts`, which is called when a
normalized path is needed.

2 years agogh-103171: Forward-port new tests for runtime-checkable protocols dec orated with...
Alex Waygood [Wed, 7 Jun 2023 22:25:17 +0000 (23:25 +0100)] 
gh-103171: Forward-port new tests for runtime-checkable protocols dec orated with `@final` (#105473)

Forward-port of the tests that were added to the 3.11 branch in #105445

2 years agogh-105390: Add explicit type cast (#105466)
Kirill Podoprigora [Wed, 7 Jun 2023 20:20:43 +0000 (23:20 +0300)] 
gh-105390: Add explicit type cast (#105466)

2 years agogh-94673: Ensure subtypes are readied only once in math.trunc() (gh-105465)
neonene [Wed, 7 Jun 2023 19:46:00 +0000 (04:46 +0900)] 
gh-94673: Ensure subtypes are readied only once in math.trunc() (gh-105465)

Fixes a typo in d2e2e53.

2 years agogh-90015: Document that PEP-604 unions do not support forward references (#105366)
Alex Waygood [Wed, 7 Jun 2023 17:26:23 +0000 (18:26 +0100)] 
gh-90015: Document that PEP-604 unions do not support forward references (#105366)

2 years agogh-104610: Stop looking for PREDICT() in the cases generator (#105459)
Guido van Rossum [Wed, 7 Jun 2023 17:00:10 +0000 (10:00 -0700)] 
gh-104610: Stop looking for PREDICT() in the cases generator (#105459)

We no longer use `PREDICT()`, it doesn't have any benefits.

2 years agoFix grammar and improve clarity for an deprecation message. (GH-105457)
Raymond Hettinger [Wed, 7 Jun 2023 16:29:04 +0000 (11:29 -0500)] 
Fix grammar and improve clarity for an deprecation message. (GH-105457)

2 years agoGH-104610: Remove the use of `PREDICT` macros. (GH-104651)
Mark Shannon [Wed, 7 Jun 2023 16:04:53 +0000 (17:04 +0100)] 
GH-104610: Remove the use of `PREDICT` macros. (GH-104651)

2 years agotyping: Improve documentation of generic classes and aliases (#105369)
Alex Waygood [Wed, 7 Jun 2023 14:02:40 +0000 (15:02 +0100)] 
typing: Improve documentation of generic classes and aliases (#105369)