]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-101072: support default and kw default in PyEval_EvalCodeEx for 3.11+ (#101127)
Matthieu Dartiailh [Tue, 7 Feb 2023 09:34:21 +0000 (10:34 +0100)] 
gh-101072: support default and kw default in PyEval_EvalCodeEx  for 3.11+ (#101127)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2 years agogh-85747: Active voice & suggested edits, 'running/stopping loop' & 'callbacks' subse...
Brian Skinn [Tue, 7 Feb 2023 05:25:42 +0000 (00:25 -0500)] 
gh-85747: Active voice & suggested edits, 'running/stopping loop' & 'callbacks' subsections of asyncio-eventloop.rst (#100270)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-98831: Move DSL documentation here from ideas repo (#101629)
Guido van Rossum [Tue, 7 Feb 2023 05:03:58 +0000 (21:03 -0800)] 
gh-98831: Move DSL documentation here from ideas repo (#101629)

2 years agogh-99108: Replace SHA2-224 & 256 with verified code from HACL* (#99109)
Jonathan Protzenko [Tue, 7 Feb 2023 02:11:01 +0000 (18:11 -0800)] 
gh-99108: Replace SHA2-224 & 256 with verified code from HACL* (#99109)

replacing hashlib primitives (for the non-OpenSSL case) with verified implementations from HACL*. This is the first PR in the series, and focuses specifically on SHA2-256 and SHA2-224.

This PR imports Hacl_Streaming_SHA2 into the Python tree. This is the HACL* implementation of SHA2, which combines a core implementation of SHA2 along with a layer of buffer management that allows updating the digest with any number of bytes. This supersedes the previous implementation in the tree.

@franziskuskiefer was kind enough to benchmark the changes: in addition to being verified (thus providing significant safety and security improvements), this implementation also provides a sizeable performance boost!

```
---------------------------------------------------------------
Benchmark                     Time             CPU   Iterations
---------------------------------------------------------------
Sha2_256_Streaming            3163 ns      3160 ns       219353     // this PR
LibTomCrypt_Sha2_256          5057 ns      5056 ns       136234     // library used by Python currently
```

The changes in this PR are as follows:
- import the subset of HACL* that covers SHA2-256/224 into `Modules/_hacl`
- rewire sha256module.c to use the HACL* implementation

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agogh-59956: Add a Test to Verify GILState Matches the "Current" Thread State (gh-101625)
Eric Snow [Mon, 6 Feb 2023 22:53:31 +0000 (15:53 -0700)] 
gh-59956: Add a Test to Verify GILState Matches the "Current" Thread State (gh-101625)

This test should have been in gh-101431.

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

2 years agogh-98831: rewrite COPY and SWAP in the instruction definition DSL (#101620)
Irit Katriel [Mon, 6 Feb 2023 22:45:18 +0000 (22:45 +0000)] 
gh-98831: rewrite COPY and SWAP in the instruction definition DSL (#101620)

2 years agoGH-101616: Mention the Docs Discourse forum in the "reporting docs issues" (GH-101617)
Mariatta Wijaya [Mon, 6 Feb 2023 21:59:45 +0000 (13:59 -0800)] 
GH-101616: Mention the Docs Discourse forum in the "reporting docs issues" (GH-101617)

Fixes https://github.com/python/cpython/issues/101616

2 years agogh-59956: Partial Fix for GILState API Compatibility with Subinterpreters (gh-101431)
Eric Snow [Mon, 6 Feb 2023 21:39:25 +0000 (14:39 -0700)] 
gh-59956: Partial Fix for GILState API Compatibility with Subinterpreters (gh-101431)

The GILState API (PEP 311) implementation from 2003 made the assumption that only one thread state would ever be used for any given OS thread, explicitly disregarding the case of subinterpreters.  However, PyThreadState_Swap() still facilitated switching between subinterpreters, meaning the "current" thread state (holding the GIL), and the GILState thread state could end up out of sync, causing problems (including crashes).

This change addresses the issue by keeping the two in sync in PyThreadState_Swap().  I verified the fix against gh-99040.

Note that the other GILState-subinterpreter incompatibility (with autoInterpreterState) is not resolved here.

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

2 years agogh-101609: Fix "‘state’ may be used uninitialized" warning in `_xxinterpchannelsmodul...
Nikita Sobolev [Mon, 6 Feb 2023 21:05:41 +0000 (00:05 +0300)] 
gh-101609: Fix "‘state’ may be used uninitialized" warning in `_xxinterpchannelsmodule` (GH-101610)

I went with the easiest solution: just removing the offending line. See the issue description with my reasoning.

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

2 years agogh-101562: typing: add tests for inheritance with NotRequired & Required in parent...
Eclips4 [Mon, 6 Feb 2023 19:28:24 +0000 (22:28 +0300)] 
gh-101562: typing: add tests for inheritance with NotRequired & Required in parent fields (#101563)

2 years agogh-101543: Ensure Windows registry path is only used when stdlib can't be found ...
Steve Dower [Mon, 6 Feb 2023 15:55:32 +0000 (15:55 +0000)] 
gh-101543: Ensure Windows registry path is only used when stdlib can't be found (GH-101544)

2 years agogh-76961: Fix buildbot failures in test_pep3118 (#101587) 101604/head
Mark Dickinson [Mon, 6 Feb 2023 12:25:31 +0000 (12:25 +0000)] 
gh-76961: Fix buildbot failures in test_pep3118 (#101587)

This PR fixes the buildbot failures introduced by the merge of #5561, by restricting the relevant tests to something that should work on both 32-bit and 64-bit platforms. It also silences some compiler warnings introduced in that PR.

2 years agogh-101372: Fix unicodedata.is_normalized to properly handle the UCD 3… (gh-101388)
Dong-hee Na [Mon, 6 Feb 2023 04:58:00 +0000 (13:58 +0900)] 
gh-101372: Fix unicodedata.is_normalized to properly handle the UCD 3… (gh-101388)

2 years agogh-101541: [Enum] create flag psuedo-member without calling original __new__ (GH...
Ethan Furman [Mon, 6 Feb 2023 03:29:06 +0000 (19:29 -0800)] 
gh-101541: [Enum] create flag psuedo-member without calling original __new__ (GH-101590)

2 years agoTrivial Change: Remove unhelpful doc in `datetime.timedelta` (#100164)
Matty G [Mon, 6 Feb 2023 02:55:37 +0000 (18:55 -0800)] 
Trivial Change: Remove unhelpful doc in `datetime.timedelta` (#100164)

2 years agogh-101334: Don't force USTAR format in test_tarfile. (GH-101572)
Gregory P. Smith [Sun, 5 Feb 2023 17:44:57 +0000 (09:44 -0800)] 
gh-101334: Don't force USTAR format in test_tarfile. (GH-101572)

That causes the test to fail when run using a high UID as that ancient format
cannot represent it. The current default (PAX) and the old default (GNU) both
support high UIDs.

2 years agobpo-33591: Add support for path like objects to `ctypes.CDLL` (#7032)
mrh1997 [Sun, 5 Feb 2023 17:36:57 +0000 (18:36 +0100)] 
bpo-33591: Add support for path like objects to `ctypes.CDLL` (#7032)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2 years agogh-76961: Fix the PEP3118 format string for ctypes.Structure (#5561)
Eric Wieser [Sun, 5 Feb 2023 17:10:53 +0000 (17:10 +0000)] 
gh-76961: Fix the PEP3118 format string for ctypes.Structure (#5561)

The summary of this diff is that it:

* adds a `_ctypes_alloc_format_padding` function to append strings like `37x` to a format string to indicate 37 padding bytes
* removes the branches that amount to "give up on producing a valid format string if the struct is packed"
* combines the resulting adjacent `if (isStruct) {`s now that neither is `if (isStruct && !isPacked) {`
* invokes `_ctypes_alloc_format_padding` to add padding between structure fields, and after the last structure field. The computation used for the total size is unchanged from ctypes already used.

This patch does not affect any existing aligment computation; all it does is use subtraction to deduce the amount of paddnig introduced by the existing code.

---

Without this fix, it would never include padding bytes - an assumption that was only
valid in the case when `_pack_` was set - and this case was explicitly not implemented.

This should allow conversion from ctypes structs to numpy structs

Fixes https://github.com/numpy/numpy/issues/10528

2 years agoRevert "gh-89381: Fix invalid signatures of math/cmath.log (#101404)" (#101580)
Mark Dickinson [Sun, 5 Feb 2023 16:36:33 +0000 (16:36 +0000)] 
Revert "gh-89381: Fix invalid signatures of math/cmath.log (#101404)" (#101580)

This reverts commit 0ef92d979311ba82d4c41b22ef38e12e1b08b13d.

2 years agogh-101570: Update bundled pip version to 23.0 (#101571)
Pradyun Gedam [Sun, 5 Feb 2023 11:30:44 +0000 (11:30 +0000)] 
gh-101570: Update bundled pip version to 23.0 (#101571)

Update bundled pip version to 23.0

This is the current latest version of `pip`.

---------

Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years agogh-101266: Fix __sizeof__ for subclasses of int (#101394)
Mark Dickinson [Sun, 5 Feb 2023 10:02:53 +0000 (10:02 +0000)] 
gh-101266: Fix __sizeof__ for subclasses of int (#101394)

Fix the behaviour of the `__sizeof__` method (and hence the results returned by `sys.getsizeof`) for subclasses of `int`. Previously, `int` subclasses gave identical results to the `int` base class, ignoring the presence of the instance dictionary.

<!-- gh-issue-number: gh-101266 -->
* Issue: gh-101266
<!-- /gh-issue-number -->

2 years agogh-101221: Add options in the documentation of timeit command (#101222)
busywhitespace [Sun, 5 Feb 2023 09:55:36 +0000 (10:55 +0100)] 
gh-101221: Add options in the documentation of timeit command (#101222)

2 years agoAdd missing preposition in argparse docs (#101548)
alnoki [Sun, 5 Feb 2023 09:45:07 +0000 (01:45 -0800)] 
Add missing preposition in argparse docs (#101548)

2 years agoFix detection of presence of time.tzset (gh-101539) (#101540)
Alexander Belopolsky [Sun, 5 Feb 2023 07:14:15 +0000 (11:14 +0400)] 
Fix detection of presence of time.tzset (gh-101539) (#101540)

Resolves gh-101539
Related to gh-31898

2 years agoGH-100485: Create an alternative code path when an accurate fma() implementation...
Raymond Hettinger [Sat, 4 Feb 2023 23:54:44 +0000 (17:54 -0600)] 
GH-100485: Create an alternative code path when an accurate fma() implementation is not available (#101567)

2 years agogh-101322: Ensure test_zlib.ZlibDecompressorTest runs, fix errors in ZlibDecompressor...
Ruben Vorderman [Sat, 4 Feb 2023 20:07:30 +0000 (21:07 +0100)] 
gh-101322: Ensure test_zlib.ZlibDecompressorTest runs, fix errors in ZlibDecompressor (#101323)

* Ensure test_zlib.ZlibDecompressorTest actually runs, fix errors in ZlibDecompressor.

2 years agogh-101282: Update BOLT --split-functions flag not to use deprecated u… (gh-101557)
Dong-hee Na [Sat, 4 Feb 2023 07:55:31 +0000 (16:55 +0900)] 
gh-101282: Update BOLT --split-functions flag not to use deprecated u… (gh-101557)

gh-101282: Update BOLT --split-functions flag not to use deprecated usage

2 years agoGH-56426: Add cross-reference to the documentation for faulthandler, traceback, and...
Furkan Onder [Sat, 4 Feb 2023 03:49:29 +0000 (03:49 +0000)] 
GH-56426: Add cross-reference to the documentation for faulthandler, traceback, and pdb. (#101157)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoAdd missing `versionadded` directive for `PyCode_Addr2Location` (#101347)
Max Bachmann [Sat, 4 Feb 2023 03:33:28 +0000 (04:33 +0100)] 
Add missing `versionadded` directive for `PyCode_Addr2Location` (#101347)

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.)