Commit Graph

115955 Commits

Author SHA1 Message Date
Łukasz Langa 7990324048
[gh-101072] Fix Blurb for GH-101127 2023-02-07 10:50:39 +01:00
Matthieu Dartiailh ae62bddaf8
gh-101072: support default and kw default in PyEval_EvalCodeEx for 3.11+ (#101127)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-02-07 10:34:21 +01:00
Brian Skinn c4de6b1d52
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>
2023-02-06 21:25:42 -08:00
Guido van Rossum 694e346a01
gh-98831: Move DSL documentation here from ideas repo (#101629) 2023-02-06 21:03:58 -08:00
Jonathan Protzenko 1fcc0efdaa
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>
2023-02-06 18:11:01 -08:00
Eric Snow 914f8fd9f7
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
2023-02-06 15:53:31 -07:00
Irit Katriel 38752760c9
gh-98831: rewrite COPY and SWAP in the instruction definition DSL (#101620) 2023-02-06 22:45:18 +00:00
Mariatta Wijaya 949c58f945
GH-101616: Mention the Docs Discourse forum in the "reporting docs issues" (GH-101617)
Fixes https://github.com/python/cpython/issues/101616
2023-02-06 13:59:45 -08:00
Eric Snow 132b3f8302
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
2023-02-06 14:39:25 -07:00
Nikita Sobolev 262003fd32
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
2023-02-06 13:05:41 -08:00
Eclips4 b96b344f25
gh-101562: typing: add tests for inheritance with NotRequired & Required in parent fields (#101563) 2023-02-06 11:28:24 -08:00
Steve Dower 7a253103d4
gh-101543: Ensure Windows registry path is only used when stdlib can't be found (GH-101544) 2023-02-06 15:55:32 +00:00
Mark Dickinson 46416b9004
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.
2023-02-06 12:25:31 +00:00
Dong-hee Na 9ef7e75434
gh-101372: Fix unicodedata.is_normalized to properly handle the UCD 3… (gh-101388) 2023-02-06 13:58:00 +09:00
Ethan Furman ef7c2bfcf1
gh-101541: [Enum] create flag psuedo-member without calling original __new__ (GH-101590) 2023-02-05 19:29:06 -08:00
Matty G d3e2dd6e71
Trivial Change: Remove unhelpful doc in `datetime.timedelta` (#100164) 2023-02-06 06:55:37 +04:00
Gregory P. Smith ffcb8220d7
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.
2023-02-05 09:44:57 -08:00
mrh1997 f7e9fbacb2
bpo-33591: Add support for path like objects to `ctypes.CDLL` (#7032)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-02-05 23:06:57 +05:30
Eric Wieser 90d85a9b41
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
2023-02-05 17:10:53 +00:00
Mark Dickinson 0672a6c23b
Revert "gh-89381: Fix invalid signatures of math/cmath.log (#101404)" (#101580)
This reverts commit 0ef92d9793.
2023-02-05 16:36:33 +00:00
Pradyun Gedam 19ac43629e
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>
2023-02-05 11:30:44 +00:00
Mark Dickinson 39017e04b5
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 -->
2023-02-05 10:02:53 +00:00
busywhitespace 9b60ee976a
gh-101221: Add options in the documentation of timeit command (#101222) 2023-02-05 15:25:36 +05:30
alnoki 6e4a521c2a
Add missing preposition in argparse docs (#101548) 2023-02-05 15:15:07 +05:30
Alexander Belopolsky ddd619cffa
Fix detection of presence of time.tzset (gh-101539) (#101540)
Resolves gh-101539
Related to gh-31898
2023-02-05 11:14:15 +04:00
Raymond Hettinger 5a2b984568
GH-100485: Create an alternative code path when an accurate fma() implementation is not available (#101567) 2023-02-04 17:54:44 -06:00
Ruben Vorderman a89e6713c4
gh-101322: Ensure test_zlib.ZlibDecompressorTest runs, fix errors in ZlibDecompressor (#101323)
* Ensure test_zlib.ZlibDecompressorTest actually runs, fix errors in ZlibDecompressor.
2023-02-04 12:07:30 -08:00
Dong-hee Na 144aaa74bb
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
2023-02-04 16:55:31 +09:00
Furkan Onder cef9de62b8
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>
2023-02-04 09:19:29 +05:30
Max Bachmann f11a3d1ebe
Add missing `versionadded` directive for `PyCode_Addr2Location` (#101347) 2023-02-04 09:03:28 +05:30
Eric Snow c67b00534a
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
2023-02-03 18:14:43 -07:00
Gregory P. Smith d4c410f0f9
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.
2023-02-03 15:20:46 -08:00
Steve Dower f6c53b80a1
gh-101522: Allow overriding Windows dependencies versions and paths using MSBuild properties (GH-101523) 2023-02-03 18:08:34 +00:00
Irit Katriel 433fb3ef08
gh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction definition DSL (#101529) 2023-02-03 14:40:45 +00:00
Irit Katriel 04e06e20ee
gh-98831: rewrite SEND, GET_YIELD_FROM_ITER, RETURN_GENERATOR in the instruction definition DSL (#101516) 2023-02-03 11:30:21 +00:00
Erlend E. Aasland a52cc9853f
gh-101277: Port more `itertools` static types to heap types (#101303)
Add dropwhile, takewhile, starmap, combinations*, and permutations types to module state.
2023-02-03 15:24:27 +05:30
François Magimel 45d014e03b
docs: replace PyPI description with link (#101506) 2023-02-03 12:53:11 +05:30
Viet Than 5c39daf50b
gh-100920: Update documentation for `asyncio.StreamWriter.wait_closed` (#101514) 2023-02-03 12:48:39 +05:30
Gregory P. Smith 5dcae3f0c3
gh-84559: skip the test when no multiprocessing (wasm, etc) (#101530)
skip test when no _multiprocessing (wasm, etc)
2023-02-02 17:14:23 -08:00
C.A.M. Gerlach 1b6045668d
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
2023-02-03 08:03:27 +08:00
Gregory P. Smith 0ca67e6313
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.
2023-02-02 15:50:35 -08:00
Ayappan Perumal 618b7a8260
gh-98705: Fix AIX build by undefining `__bool__` in C (#98768) 2023-02-02 12:32:33 -08:00
Ayappan Perumal ba4731d149
gh-96305: Fix AIX build by avoiding subprocess during bootstrap (#96429)
* Fix AIX build by avoiding `subprocess` during bootstrap.
2023-02-02 12:30:49 -08:00
Peter Gessler 24cbc7a2a0
docs: Fix enum reassign `str` documentation (GH-101507) 2023-02-02 12:12:57 -08:00
Irit Katriel 0675b8f032
gh-98831: rewrite RERAISE and CLEANUP_THROW in the instruction definition DSL (#101511) 2023-02-02 10:02:57 +00:00
Marcos Pereira ee21110086
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>
2023-02-02 00:52:29 +01:00
Guido van Rossum ae9b38f424
gh-98831: Modernize the LOAD_GLOBAL family (#101502) 2023-02-01 13:12:49 -08:00
Steve Dower eda60916bc
gh-101467: Correct py.exe handling of prefix matches and cases when only one runtime is installed (GH-101468) 2023-02-01 21:06:56 +00:00
Irit Katriel b91b42d236
gh-98831: rewrite PUSH_EXC_INFO and conditional jumps in the instruction definition DSL (#101481) 2023-02-01 19:38:06 +00:00
Guido van Rossum 7840ff3cdb
gh-98831: Modernize the LOAD_ATTR family (#101488) 2023-02-01 10:56:52 -08:00