]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-101524: Split Up the _xxsubinterpreters Module (gh-101526)
Eric Snow [Sat, 4 Feb 2023 01:14:43 +0000 (18:14 -0700)] 
gh-101524: Split Up the _xxsubinterpreters Module (gh-101526)

This is step 1 in potentially dropping all the "channel"-related code. Channels have already been removed from PEP 554.

https://github.com/python/cpython/issues/101524

2 years agogh-84559: Remove the new multiprocessing warning, too disruptive. (#101551)
Gregory P. Smith [Fri, 3 Feb 2023 23:20:46 +0000 (15:20 -0800)] 
gh-84559: Remove the new multiprocessing warning, too disruptive. (#101551)

This reverts the core of #100618 while leaving relevant documentation
improvements and minor refactorings in place.

2 years agogh-101522: Allow overriding Windows dependencies versions and paths using MSBuild...
Steve Dower [Fri, 3 Feb 2023 18:08:34 +0000 (18:08 +0000)] 
gh-101522: Allow overriding Windows dependencies versions and paths using MSBuild properties (GH-101523)

2 years agogh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction definition DSL...
Irit Katriel [Fri, 3 Feb 2023 14:40:45 +0000 (14:40 +0000)] 
gh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction definition DSL (#101529)

2 years agogh-98831: rewrite SEND, GET_YIELD_FROM_ITER, RETURN_GENERATOR in the instruction...
Irit Katriel [Fri, 3 Feb 2023 11:30:21 +0000 (11:30 +0000)] 
gh-98831: rewrite SEND, GET_YIELD_FROM_ITER, RETURN_GENERATOR in the instruction definition DSL (#101516)

2 years agogh-101277: Port more `itertools` static types to heap types (#101303)
Erlend E. Aasland [Fri, 3 Feb 2023 09:54:27 +0000 (10:54 +0100)] 
gh-101277: Port more `itertools` static types to heap types (#101303)

Add dropwhile, takewhile, starmap, combinations*, and permutations types to module state.

2 years agodocs: replace PyPI description with link (#101506)
François Magimel [Fri, 3 Feb 2023 07:23:11 +0000 (08:23 +0100)] 
docs: replace PyPI description with link (#101506)

2 years agogh-100920: Update documentation for `asyncio.StreamWriter.wait_closed` (#101514)
Viet Than [Fri, 3 Feb 2023 07:18:39 +0000 (02:18 -0500)] 
gh-100920: Update documentation for `asyncio.StreamWriter.wait_closed` (#101514)

2 years agogh-84559: skip the test when no multiprocessing (wasm, etc) (#101530)
Gregory P. Smith [Fri, 3 Feb 2023 01:14:23 +0000 (17:14 -0800)] 
gh-84559: skip the test when no multiprocessing (wasm, etc) (#101530)

skip test when no _multiprocessing (wasm, etc)

2 years agogh-100925: Move array methods under class in array doc (#101485)
C.A.M. Gerlach [Fri, 3 Feb 2023 00:03:27 +0000 (18:03 -0600)] 
gh-100925: Move array methods under class in array doc (#101485)

* Move array methods under class in array doc

* Fix a few internal references related to the touched lines

2 years agoGH-84559: Deprecate fork being the multiprocessing default. (#100618)
Gregory P. Smith [Thu, 2 Feb 2023 23:50:35 +0000 (15:50 -0800)] 
GH-84559: Deprecate fork being the multiprocessing default. (#100618)

This starts the process. Users who don't specify their own start method
and use the default on platforms where it is 'fork' will see a
DeprecationWarning upon multiprocessing.Pool() construction or upon
multiprocessing.Process.start() or concurrent.futures.ProcessPool use.

See the related issue and documentation within this change for details.

2 years agogh-98705: Fix AIX build by undefining `__bool__` in C (#98768)
Ayappan Perumal [Thu, 2 Feb 2023 20:32:33 +0000 (02:02 +0530)] 
gh-98705: Fix AIX build by undefining `__bool__` in C  (#98768)

2 years agogh-96305: Fix AIX build by avoiding subprocess during bootstrap (#96429)
Ayappan Perumal [Thu, 2 Feb 2023 20:30:49 +0000 (02:00 +0530)] 
gh-96305: Fix AIX build by avoiding subprocess during bootstrap (#96429)

* Fix AIX build by avoiding `subprocess` during bootstrap.

2 years agodocs: Fix enum reassign `str` documentation (GH-101507)
Peter Gessler [Thu, 2 Feb 2023 20:12:57 +0000 (14:12 -0600)] 
docs: Fix enum reassign `str` documentation (GH-101507)

2 years agogh-98831: rewrite RERAISE and CLEANUP_THROW in the instruction definition DSL (#101511)
Irit Katriel [Thu, 2 Feb 2023 10:02:57 +0000 (10:02 +0000)] 
gh-98831: rewrite RERAISE and CLEANUP_THROW in the instruction definition DSL (#101511)

2 years agoDocs: improve accuracy of sqlite3 `check_same_thread` parameter (#101351)
Marcos Pereira [Wed, 1 Feb 2023 23:52:29 +0000 (23:52 +0000)] 
Docs: improve accuracy of sqlite3 `check_same_thread` parameter (#101351)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-98831: Modernize the LOAD_GLOBAL family (#101502)
Guido van Rossum [Wed, 1 Feb 2023 21:12:49 +0000 (13:12 -0800)] 
gh-98831: Modernize the LOAD_GLOBAL family (#101502)

2 years agogh-101467: Correct py.exe handling of prefix matches and cases when only one runtime...
Steve Dower [Wed, 1 Feb 2023 21:06:56 +0000 (21:06 +0000)] 
gh-101467: Correct py.exe handling of prefix matches and cases when only one runtime is installed (GH-101468)

2 years agogh-98831: rewrite PUSH_EXC_INFO and conditional jumps in the instruction definition...
Irit Katriel [Wed, 1 Feb 2023 19:38:06 +0000 (19:38 +0000)] 
gh-98831: rewrite PUSH_EXC_INFO and conditional jumps in the instruction definition DSL (#101481)

2 years agogh-98831: Modernize the LOAD_ATTR family (#101488)
Guido van Rossum [Wed, 1 Feb 2023 18:56:52 +0000 (10:56 -0800)] 
gh-98831: Modernize the LOAD_ATTR family (#101488)

2 years agogh-101498 : Fix asyncio.Timeout example in docs (#101499)
Raj [Wed, 1 Feb 2023 18:08:31 +0000 (23:38 +0530)] 
gh-101498 : Fix asyncio.Timeout example in docs (#101499)

Doc/library/asyncio-task.rst#timeout

2 years agogh-101454: fix documentation for END_ASYNC_FOR (#101455)
Irit Katriel [Wed, 1 Feb 2023 12:49:59 +0000 (12:49 +0000)] 
gh-101454: fix documentation for END_ASYNC_FOR (#101455)

2 years agogh-101277: Isolate itertools, add group and _grouper types to module state (#101302)
Erlend E. Aasland [Wed, 1 Feb 2023 11:41:30 +0000 (12:41 +0100)] 
gh-101277: Isolate itertools, add group and _grouper types to module state (#101302)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agogh-101317: Add `ssl_shutdown_timeout` parameter for `asyncio.StreamWriter.start_tls...
beavailable [Wed, 1 Feb 2023 11:03:59 +0000 (19:03 +0800)] 
gh-101317: Add `ssl_shutdown_timeout` parameter for `asyncio.StreamWriter.start_tls` (#101335)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agodatetime.rst: fix combine() signature (#101490)
John Belmonte [Wed, 1 Feb 2023 10:01:28 +0000 (19:01 +0900)] 
datetime.rst: fix combine() signature (#101490)

The default `tzinfo` param of the `combine()` signature pseudocode was erroneously `self.tzinfo`.

`self` has no meaning in the context of a classmethod, and the datetime class itself has no `tzinfo` attribute.  The correct default pseudocode is `time.tzinfo`, reflecting that the default is the `tzinfo` attribute of the `time` parameter.

2 years agoGH-100288: Skip extra work when failing to specialize LOAD_ATTR (GH-101354)
Brandt Bucher [Tue, 31 Jan 2023 21:28:32 +0000 (13:28 -0800)] 
GH-100288: Skip extra work when failing to specialize LOAD_ATTR (GH-101354)

2 years agogh-101409: Improve generated clinic code for self type checks (#101411)
Erlend E. Aasland [Tue, 31 Jan 2023 20:42:03 +0000 (21:42 +0100)] 
gh-101409: Improve generated clinic code for self type checks (#101411)

2 years agogh-98831: rewrite BEFORE_ASYNC_WITH and END_ASYNC_FOR in the instruction definition...
Irit Katriel [Tue, 31 Jan 2023 18:47:50 +0000 (18:47 +0000)] 
gh-98831: rewrite BEFORE_ASYNC_WITH and END_ASYNC_FOR in the instruction definition DSL (#101458)

2 years agogh-101469: Optimise get_io_state() by using _PyModule_GetState() (GH-101470)
Erlend E. Aasland [Tue, 31 Jan 2023 18:19:11 +0000 (19:19 +0100)] 
gh-101469: Optimise get_io_state() by using _PyModule_GetState() (GH-101470)

Automerge-Triggered-By: GH:erlend-aasland
2 years agogh-101440: fix json snippet error in logging-cookbook.rst (#101439)
Peter Jiping Xie [Tue, 31 Jan 2023 15:30:38 +0000 (02:30 +1100)] 
gh-101440: fix json snippet error in logging-cookbook.rst (#101439)

2 years agogh-99276 - Updated Doc/faq/general.rst (#101396)
Raj [Tue, 31 Jan 2023 15:16:17 +0000 (20:46 +0530)] 
gh-99276 - Updated Doc/faq/general.rst (#101396)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoAdd JOBS parameter to docs Makefile (#101395)
Christophe Nanteuil [Tue, 31 Jan 2023 13:29:29 +0000 (14:29 +0100)] 
Add JOBS parameter to docs Makefile (#101395)

2 years agogh-98831: rewrite GET_LEN, GET_ITER, BEFORE_WITH and a few simple opcodes in the...
Irit Katriel [Tue, 31 Jan 2023 10:23:15 +0000 (10:23 +0000)] 
gh-98831: rewrite GET_LEN, GET_ITER, BEFORE_WITH and a few simple opcodes in the instruction definition DSL (#101443)

2 years agogh-77607: Improve accuracy of os.path.join docs (#101406)
Shantanu [Tue, 31 Jan 2023 05:39:30 +0000 (21:39 -0800)] 
gh-77607: Improve accuracy of os.path.join docs (#101406)

This is a follow-up to #100811.

One of the changes in that PR isn't accurate in that
`os.path.join('', '')` will not end in a separator.

This reverts that change to the previous wording that used "only", but
explicitly calls out the case where the last part ends in a separator,
which is what caused confusin in #77607 and motivated the change
in #100811.

2 years agoFixes typo in asyncio.TaskGroup context manager code example (#101449)
Ben [Tue, 31 Jan 2023 05:36:40 +0000 (00:36 -0500)] 
Fixes typo in asyncio.TaskGroup context manager code example (#101449)

2 years agogh-98831: Clean up and add cache size static_assert to macro (#101442)
Guido van Rossum [Tue, 31 Jan 2023 01:27:51 +0000 (17:27 -0800)] 
gh-98831: Clean up and add cache size static_assert to macro (#101442)

2 years agogh-99955: use SUCCESS/ERROR return values in optimizer and assembler. Use RETURN_IF_E...
Irit Katriel [Tue, 31 Jan 2023 00:06:19 +0000 (00:06 +0000)] 
gh-99955: use SUCCESS/ERROR return values in optimizer and assembler. Use RETURN_IF_ERROR where appropriate. Fix a couple of bugs. (#101412)

2 years agogh-101400: Fix incorrect lineno in exception message on continue/break which are...
Dong-hee Na [Mon, 30 Jan 2023 23:33:54 +0000 (08:33 +0900)] 
gh-101400: Fix incorrect lineno in exception message on continue/break which are not in a loop (#101413)

2 years agogh-101229: Add tests for aliases of imported names (#101230)
Eclips4 [Mon, 30 Jan 2023 19:49:06 +0000 (22:49 +0300)] 
gh-101229: Add tests for aliases of imported names (#101230)

2 years agoGH-101369: Allow macros as family members (#101399)
Guido van Rossum [Mon, 30 Jan 2023 19:23:57 +0000 (11:23 -0800)] 
GH-101369: Allow macros as family members (#101399)

Also check for instructions straddling families (this includes macro parts).

2 years agogh-59956: Clarify Runtime State Status Expectations (gh-101308)
Eric Snow [Mon, 30 Jan 2023 19:07:48 +0000 (12:07 -0700)] 
gh-59956:  Clarify Runtime State Status Expectations (gh-101308)

A PyThreadState can be in one of many states in its lifecycle, represented by some status value.  Those statuses haven't been particularly clear, so we're addressing that here.  Specifically:

* made the distinct lifecycle statuses clear on PyThreadState
* identified expectations of how various lifecycle-related functions relate to status
* noted the various places where those expectations don't match the actual behavior

At some point we'll need to address the mismatches.

(This change also includes some cleanup.)

https://github.com/python/cpython/issues/59956

2 years agogh-101422: (docs) TarFile default errorlevel argument is 1, not 0 (GH-101424)
Owain Davies [Mon, 30 Jan 2023 17:56:33 +0000 (00:56 +0700)] 
gh-101422: (docs) TarFile default errorlevel argument is 1, not 0 (GH-101424)

2 years agoGH-101291: Refactor the `PyLongObject` struct into object header and PyLongValue...
Mark Shannon [Mon, 30 Jan 2023 10:03:04 +0000 (10:03 +0000)] 
GH-101291: Refactor the `PyLongObject` struct into object header and PyLongValue struct. (GH-101292)

2 years agogh-98831: Support conditional effects; use for LOAD_ATTR (#101333)
Guido van Rossum [Mon, 30 Jan 2023 01:28:39 +0000 (17:28 -0800)] 
gh-98831: Support conditional effects; use for LOAD_ATTR (#101333)

2 years agogh-39615: fix warning on return type mismatch (#101407)
Irit Katriel [Mon, 30 Jan 2023 00:41:27 +0000 (00:41 +0000)] 
gh-39615: fix warning on return type mismatch (#101407)

2 years agogh-89381: Fix invalid signatures of math/cmath.log (#101404)
Sergey B Kirpichev [Sun, 29 Jan 2023 19:50:10 +0000 (22:50 +0300)] 
gh-89381: Fix invalid signatures of math/cmath.log (#101404)

2 years agoFix trivial typo in shebang example (GH-101385)
socal-nerdtastic [Sat, 28 Jan 2023 13:18:04 +0000 (05:18 -0800)] 
Fix trivial typo in shebang example (GH-101385)

The example was showing the current version, but should be pinned to 3.7 to match the example command.

2 years agoGH-100485: Add extended accuracy test. Switch to faster fma() based variant. GH...
Raymond Hettinger [Sat, 28 Jan 2023 12:29:21 +0000 (06:29 -0600)] 
GH-100485:  Add extended accuracy test.  Switch to faster fma() based variant. GH-101383)

2 years agogh-101386: fix typos found by codespell (#101387)
Peter Jiping Xie [Sat, 28 Jan 2023 09:57:40 +0000 (20:57 +1100)] 
gh-101386: fix typos found by codespell (#101387)

2 years agogh-39615: Add warnings.warn() skip_file_prefixes support (#100840)
Gregory P. Smith [Sat, 28 Jan 2023 02:35:14 +0000 (18:35 -0800)] 
gh-39615: Add warnings.warn() skip_file_prefixes support (#100840)

`warnings.warn()` gains the ability to skip stack frames based on code
filename prefix rather than only a numeric `stacklevel=` via a new
`skip_file_prefixes=` keyword argument.

2 years agogh-101341: Remove unncessary enum._power_of_two function (gh-101342)
Dong-hee Na [Sat, 28 Jan 2023 02:08:08 +0000 (11:08 +0900)] 
gh-101341: Remove unncessary enum._power_of_two function (gh-101342)

2 years ago[doc] Add a section on logging handler configuration order. (GH-101380)
Vinay Sajip [Fri, 27 Jan 2023 19:01:30 +0000 (19:01 +0000)] 
[doc] Add a section on logging handler configuration order. (GH-101380)

2 years ago[doc] Add some notices to logging configuration documentation. (GH-101373)
Vinay Sajip [Fri, 27 Jan 2023 14:50:09 +0000 (14:50 +0000)] 
[doc] Add some notices to logging configuration documentation. (GH-101373)

2 years agogh-77532: Minor tweaks to allow compiling with PlatformToolset=ClangCL on Windows...
Steve Dower [Fri, 27 Jan 2023 14:45:08 +0000 (14:45 +0000)] 
gh-77532: Minor tweaks to allow compiling with PlatformToolset=ClangCL on Windows (GH-101352)

To use this, ensure that clang support was selected in Visual Studio Installer, then set the PlatformToolset environment variable to "ClangCL" and build as normal from the command line.
It remains unsupported, but at least is possible now for experimentation.

2 years agoSpeed-up and improve accuracy with Rump Algorithms (3.1) and (5.10) (GH-101366)
Raymond Hettinger [Fri, 27 Jan 2023 07:56:19 +0000 (01:56 -0600)] 
Speed-up and improve accuracy with Rump Algorithms (3.1) and (5.10) (GH-101366)

2 years agogh-101000: Add os.path.splitroot() (#101002)
Barney Gale [Fri, 27 Jan 2023 00:28:27 +0000 (00:28 +0000)] 
gh-101000: Add os.path.splitroot() (#101002)

Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoFix typos in pystate.c file (#101348)
Виталий Дмитриев [Thu, 26 Jan 2023 23:04:11 +0000 (02:04 +0300)] 
Fix typos in pystate.c file (#101348)

2 years agogh-99834: Update bundled copy of Tcl/Tk to 8.6.13.0 on Windows (GH-101307)
Steve Dower [Thu, 26 Jan 2023 20:47:24 +0000 (20:47 +0000)] 
gh-99834: Update bundled copy of Tcl/Tk to 8.6.13.0 on Windows (GH-101307)

2 years agogh-98831: Fix two bugs in case generator (#101349)
Guido van Rossum [Thu, 26 Jan 2023 17:15:05 +0000 (09:15 -0800)] 
gh-98831: Fix two bugs in case generator (#101349)

Fix two bugs in case generator

- UndefinedLocalError when generating metadata for an 'op'
- Accidental newline inserted in test_generator.py

2 years agogh-60580: Fix a wrong type of `ctypes.wintypes.BYTE` (#97579)
Oleg Iarygin [Thu, 26 Jan 2023 14:16:27 +0000 (18:16 +0400)] 
gh-60580: Fix a wrong type of `ctypes.wintypes.BYTE` (#97579)

Created from a patch file attached to an issue, by Anatoly Techtonik.

2 years agogh-85100: Migrate BPO link to the GitHub link for malloc warnings (gh-101343)
Dong-hee Na [Thu, 26 Jan 2023 12:58:35 +0000 (21:58 +0900)] 
gh-85100: Migrate BPO link to the GitHub link for malloc warnings (gh-101343)

2 years agogh-99952: [ctypes] fix refcount issues in from_param() result. (#100169)
Yukihiro Nakadaira [Thu, 26 Jan 2023 08:28:34 +0000 (17:28 +0900)] 
gh-99952: [ctypes] fix refcount issues in from_param() result. (#100169)

Fixes a reference counting issue with `ctypes.Structure` when a `from_param()` method call is used and the structure size is larger than a C pointer `sizeof(void*)`.

This problem existed for a very long time, but became more apparent in 3.8+ by change likely due to garbage collection cleanup timing changes.

2 years agodatetime.rst: improve combine() docs (#101338)
John Belmonte [Thu, 26 Jan 2023 07:25:43 +0000 (16:25 +0900)] 
datetime.rst: improve combine() docs (#101338)

The explanation on handling of datetime as the date arg was confusingly mixed with an unrelated
item, and lacked proper arg name formatting.

2 years agogh-100522 Add a test for 'futures.as_completed' timing out with a non-zero timeout...
JosephSBoyle [Thu, 26 Jan 2023 07:01:11 +0000 (07:01 +0000)] 
gh-100522 Add a test for 'futures.as_completed' timing out with a non-zero timeout value (#100523)

2 years agogh-94518: Rename `group*` to `extra_group*` to avoid confusion (#101054)
Oleg Iarygin [Thu, 26 Jan 2023 06:50:33 +0000 (10:50 +0400)] 
gh-94518: Rename `group*` to `extra_group*` to avoid confusion (#101054)

* Rename `group*` to `extra_group*` to avoid confusion
* Rename `num_groups` into `extra_group_size`
* Rename `groups_list` to `extra_groups_packed`

2 years agogh-98831: rewrite RAISE_VARARGS in the instruction definition DSL (#101306)
Irit Katriel [Wed, 25 Jan 2023 22:29:56 +0000 (22:29 +0000)] 
gh-98831: rewrite RAISE_VARARGS in the instruction definition DSL (#101306)

2 years agoFix incorrect versions in magic number comments (GH-101301)
Brandt Bucher [Wed, 25 Jan 2023 21:30:33 +0000 (13:30 -0800)] 
Fix incorrect versions in magic number comments (GH-101301)

2 years agogh-98831: add variable stack effect support to cases generator (#101309)
Irit Katriel [Wed, 25 Jan 2023 20:41:03 +0000 (20:41 +0000)] 
gh-98831: add variable stack effect support to cases generator (#101309)

2 years agogh-101326: Fix regression when passing None to FutureIter.throw (#101327)
Shantanu [Wed, 25 Jan 2023 20:01:01 +0000 (12:01 -0800)] 
gh-101326: Fix regression when passing None to FutureIter.throw (#101327)

2 years agoGH-88597: Rename uuid's new CLI args to be in line with uuidgen. (#101248)
achhina [Wed, 25 Jan 2023 17:39:42 +0000 (12:39 -0500)] 
GH-88597: Rename uuid's new CLI args to be in line with uuidgen. (#101248)

this way they match an existing uuidgen command line tool.

2 years agoAdd advice how to freeze fewer modules (#101298)
Guido van Rossum [Wed, 25 Jan 2023 17:28:14 +0000 (09:28 -0800)] 
Add advice how to freeze fewer modules (#101298)

(And fix a bug that only occurs when you follow the advice.)

2 years agoGH-98831: Elaborate some cases_generator tests (#101299)
Guido van Rossum [Wed, 25 Jan 2023 16:55:46 +0000 (08:55 -0800)] 
GH-98831: Elaborate some cases_generator tests (#101299)

* Make macro test more elaborate
* Add test for 'register inst()'

2 years agoFix some comments in ceval.c and fix lltrace output (#101297)
Guido van Rossum [Tue, 24 Jan 2023 22:58:18 +0000 (14:58 -0800)] 
Fix some comments in ceval.c and fix lltrace output (#101297)

The comment at the top was rather outdated. :-)

Also added a note about the dangers of dump_stack().

2 years agogh-98831: rewrite pattern matching opcodes in the instruction definition DSL (#101287)
Irit Katriel [Tue, 24 Jan 2023 22:39:13 +0000 (22:39 +0000)] 
gh-98831: rewrite pattern matching opcodes in the instruction definition DSL (#101287)

2 years agoGH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. (GH-101013)
Mark Shannon [Tue, 24 Jan 2023 17:25:37 +0000 (17:25 +0000)] 
GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. (GH-101013)

* Store exception stack depth in YIELD_VALUE's oparg and use it avoid expensive gen.throw() in gen.close() where possible.

2 years agogh-101135: Add backwards compatibility to Windows launcher for older 32-bit versions...
Martin Boisvert [Tue, 24 Jan 2023 16:35:16 +0000 (11:35 -0500)] 
gh-101135: Add backwards compatibility to Windows launcher for older 32-bit versions (GH-101138)

Python 2.x and up to 3.4 did not contain the "-32" in their registry name, so the 32 and 64-bit installs were treated equal. Since 3.5/PEP 514 this is no longer true, but we still want to detect the EOL versions correctly in case people are still using them.

Additionally, the code to replace a node with one with a lower sort key was buggy (wrong node chosen, replace never happened since parent was always NULL, replaced node never freed, etc)

2 years agogh-92123: Adapt _elementtree to multi-phase init (PEP 489) (#101285)
Erlend E. Aasland [Tue, 24 Jan 2023 16:00:24 +0000 (17:00 +0100)] 
gh-92123: Adapt _elementtree to multi-phase init (PEP 489) (#101285)

2 years agoGH-91375: Purge `asyncio` static variables from globals-to-fix list (#101288)
Erlend E. Aasland [Tue, 24 Jan 2023 15:07:27 +0000 (16:07 +0100)] 
GH-91375: Purge `asyncio` static variables from globals-to-fix list (#101288)

2 years agoGH-92123: Pass _elementtree state as parameter (#101189)
Erlend E. Aasland [Tue, 24 Jan 2023 11:45:55 +0000 (12:45 +0100)] 
GH-92123: Pass _elementtree state as parameter (#101189)

2 years agono-issue: Add Dong-hee Na as autoconf codeowner (gh-101281)
Dong-hee Na [Tue, 24 Jan 2023 10:22:22 +0000 (19:22 +0900)] 
no-issue: Add Dong-hee Na as autoconf codeowner (gh-101281)

2 years agogh-101278: Drop -gdwarf-4 flag from the BOLT build (gh-101280)
Dong-hee Na [Tue, 24 Jan 2023 10:22:00 +0000 (19:22 +0900)] 
gh-101278: Drop -gdwarf-4 flag from the BOLT build (gh-101280)

2 years agogh-98831: rewrite CHECK_EG_MATCH opcode in the instruction definition DSL (#101269)
Irit Katriel [Tue, 24 Jan 2023 09:43:16 +0000 (09:43 +0000)] 
gh-98831: rewrite CHECK_EG_MATCH opcode in the instruction definition DSL (#101269)

2 years agogh-101060: conditionally add `-fno-reorder-blocks-and-partition` (gh-101061)
Gregory Szorc [Tue, 24 Jan 2023 09:34:44 +0000 (01:34 -0800)] 
gh-101060: conditionally add `-fno-reorder-blocks-and-partition` (gh-101061)

2 years agogh-101152: Implement PEP 699 (GH-101193)
ram vikram singh [Tue, 24 Jan 2023 09:29:22 +0000 (14:59 +0530)] 
gh-101152:  Implement PEP 699 (GH-101193)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Ken Jin <kenjin@python.org>
2 years ago[docs] Mention how to get/set a bigint PyLong via the C API (#101270)
Gregory P. Smith [Tue, 24 Jan 2023 05:20:53 +0000 (21:20 -0800)] 
[docs] Mention how to get/set a bigint PyLong via the C API (#101270)

We don't need direct C APIs to get at a bigint representation of PyLong but we
do want the few people who need to understand how.

Additional Author:  CAM-Gerlach

2 years agogh-100795: Don't call freeaddrinfo on failure. (#101252)
Gregory P. Smith [Mon, 23 Jan 2023 23:03:26 +0000 (15:03 -0800)] 
gh-100795: Don't call freeaddrinfo on failure. (#101252)

When getaddrinfo returns an error, the output pointer is in an unknown state
Don't call freeaddrinfo on it.  See the issue for discussion and details with
links to reasoning.  _Most_ libc getaddrinfo implementations never modify the
output pointer unless they are returning success.

Co-authored-by: Sergey G. Brester <github@sebres.de>
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
2 years agogh-101261: add test for function with > 255 args (#101262)
Irit Katriel [Mon, 23 Jan 2023 20:10:10 +0000 (20:10 +0000)] 
gh-101261: add test for function with > 255 args (#101262)

2 years agogh-59956: Allow the "Trashcan" Mechanism to Work Without a Thread State (gh-101209)
Eric Snow [Mon, 23 Jan 2023 15:30:20 +0000 (08:30 -0700)] 
gh-59956: Allow the "Trashcan" Mechanism to Work Without a Thread State (gh-101209)

We've factored out a struct from the two PyThreadState fields. This accomplishes two things:

* make it clear that the trashcan-related code doesn't need any other parts of PyThreadState
* allows us to use the trashcan mechanism even when there isn't a "current" thread state

We still expect the caller to hold the GIL.

https://github.com/python/cpython/issues/59956

2 years agoGH-92123: Store _elementtree state in type contexts (#101190)
Erlend E. Aasland [Mon, 23 Jan 2023 12:20:36 +0000 (13:20 +0100)] 
GH-92123: Store _elementtree state in type contexts (#101190)

- add state pointer to TreeBuilderObject
- add state pointer to XMLParserObject

2 years agoAdded asyncio REPL example to docs. (#101243)
Carlton Gibson [Mon, 23 Jan 2023 11:31:13 +0000 (12:31 +0100)] 
Added asyncio REPL example to docs. (#101243)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agogh-101015: Fix `typing.get_type_hints` with unpacked `*tuple` (PEP 646) (#101031)
Nikita Sobolev [Mon, 23 Jan 2023 07:52:58 +0000 (10:52 +0300)] 
gh-101015: Fix `typing.get_type_hints` with unpacked `*tuple` (PEP 646) (#101031)

2 years agogh-83122: Deprecate testing element truth values in `ElementTree` (#31149)
Jacob Walls [Mon, 23 Jan 2023 01:16:48 +0000 (20:16 -0500)] 
gh-83122: Deprecate testing element truth values in `ElementTree` (#31149)

When testing element truth values, emit a DeprecationWarning in all implementations.

This had emitted a FutureWarning in the rarely used python-only implementation since ~2.7 and has always been documented as a behavior not to rely on.

Matching an element in a tree search but having it test False can be unexpected. Raising the warning enables making the choice to finally raise an exception for this ambiguous behavior in the future.

2 years agoSumprod(): Update citation. Reorder functions. Add final twosum() call. Improve comme...
Raymond Hettinger [Sun, 22 Jan 2023 23:07:52 +0000 (17:07 -0600)] 
Sumprod(): Update citation. Reorder functions. Add final twosum() call. Improve comments. (#101249)

2 years agogh-101047: Remove vestigial references to macOS libtool options (gh-101048)
Gregory Szorc [Sun, 22 Jan 2023 22:26:42 +0000 (14:26 -0800)] 
gh-101047: Remove vestigial references to macOS libtool options (gh-101048)

LIBTOOL_CRUFT and OTHER_LIBTOOL_OPT variables have been unused since commit
19199830f7f880b1e9cff5d92d30706fd8bb4700 in 2011.

2 years agoAdd Erlend Aasland as autoconf codeowner (#101247)
Erlend E. Aasland [Sun, 22 Jan 2023 22:02:15 +0000 (23:02 +0100)] 
Add Erlend Aasland as autoconf codeowner (#101247)

2 years agoGH-101097: Switch from standard interval notation to greater or less than signs for...
Andrew Hong [Sun, 22 Jan 2023 20:58:36 +0000 (15:58 -0500)] 
GH-101097: Switch from standard interval notation to greater or less than signs for random.random()'s documentation (#101119)

2 years agogh-67790: Support float-style formatting for Fraction instances (#100161)
Mark Dickinson [Sun, 22 Jan 2023 18:44:49 +0000 (18:44 +0000)] 
gh-67790: Support float-style formatting for Fraction instances (#100161)

This PR adds support for float-style formatting for `Fraction` objects: it supports the `"e"`, `"E"`, `"f"`, `"F"`, `"g"`, `"G"` and `"%"` presentation types, and all the various bells and whistles of the formatting mini-language for those presentation types. The behaviour almost exactly matches that of `float`, but the implementation works with the exact `Fraction` value and does not do an intermediate conversion to `float`, and so avoids loss of precision or issues with numbers that are outside the dynamic range of the `float` type.

Note that the `"n"` presentation type is _not_ supported. That support could be added later if people have a need for it.

There's one corner-case where the behaviour differs from that of float: for the `float` type, if explicit alignment is specified with a fill character of `'0'` and alignment type `'='`, then thousands separators (if specified) are inserted into the padding string:

```python
>>> format(3.14, '0=11,.2f')
'0,000,003.14'
```

The exact same effect can be achieved by using the `'0'` flag:

```python
>>> format(3.14, '011,.2f')
'0,000,003.14'
```

For `Fraction`, only the `'0'` flag has the above behaviour with respect to thousands separators: there's no special-casing of the particular `'0='` fill-character/alignment combination. Instead, we treat the fill character `'0'` just like any other:

```python
>>> format(Fraction('3.14'), '0=11,.2f')
'00000003.14'
>>> format(Fraction('3.14'), '011,.2f')
'0,000,003.14'
```

The `Fraction` formatter is also stricter about combining these two things: it's not permitted to use both the `'0'` flag _and_ explicit alignment, on the basis that we should refuse the temptation to guess in the face of ambiguity. `float` is less picky:

```python
>>> format(3.14, '0<011,.2f')
'3.140000000'
>>> format(Fraction('3.14'), '0<011,.2f')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mdickinson/Repositories/python/cpython/Lib/fractions.py", line 414, in __format__
    raise ValueError(
ValueError: Invalid format specifier '0<011,.2f' for object of type 'Fraction'; can't use explicit alignment when zero-padding
```

2 years agoRevert "gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#10122...
Kumar Aditya [Sun, 22 Jan 2023 08:47:01 +0000 (14:17 +0530)] 
Revert "gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)" (#101238)

Revert "gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)"

This reverts commit 5f08fe4a2c055880c23c6f9b57ff03005d193bfc.

2 years agogh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)
Sergey G. Brester [Sun, 22 Jan 2023 08:10:00 +0000 (09:10 +0100)] 
gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
2 years agoGH-88597: Added command line interface to UUID module. (#99463)
achhina [Sun, 22 Jan 2023 06:59:31 +0000 (01:59 -0500)] 
GH-88597: Added command line interface to UUID module. (#99463)

The `uuid` module now supports command line usage.

```python
❯ ./python.exe -m uuid
5f2d57b1-90e8-417c-ba5d-69b9b6f74289

❯ ./python.exe -m uuid -h
usage: uuid.py [-h] [-u {uuid1,uuid3,uuid4,uuid5}] [-ns NAMESPACE] [-n NAME]
...
```