Commit Graph

123567 Commits

Author SHA1 Message Date
Bénédikt Tran 7b8328b6b3
GH-121723: Skip test_config_queue_handler_multiprocessing_context in emulated JIT CI (#122969) 2024-08-13 16:25:36 -07:00
Jonathan Protzenko 325e9b8ef4
gh-99108: Add HACL* Blake2 implementation to hashlib (GH-119316)
This replaces the existing hashlib Blake2 module with a single implementation that uses HACL\*'s Blake2b/Blake2s implementations. We added support for all the modes exposed by the Python API, including tree hashing, leaf nodes, and so on. We ported and merged all of these changes upstream in HACL\*, added test vectors based on Python's existing implementation, and exposed everything needed for hashlib.

This was joint work done with @R1kM.

See the PR for much discussion and benchmarking details.   TL;DR: On many systems, 8-50% faster (!) than `libb2`, on some systems it appeared 10-20% slower than `libb2`.
2024-08-13 21:42:19 +00:00
Eric Snow ee1b8ce26e
gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952)
As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working.  This is a minimal fix just to get builds working again.  There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately.
2024-08-13 14:44:57 -06:00
Barney Gale 5f68511522
GH-85633: Fix pathlib test failures on filesystems without world-write. (#122883)
Replace `umask(0)` with `umask(0o002)` so the created files are not
world-writable, and replace `umask(0o022)` with `umask(0o026)` to check
that permissions for 'others' can still be set.
2024-08-13 17:09:21 +00:00
sobolevn 901d94992e
Fix `print` usage in `turtle` doctests (#122940) 2024-08-13 19:39:12 +03:00
Trey Hunner 906b796af8
gh-122873: Allow "python -m json" to work (#122884)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-08-13 17:09:38 +01:00
Adam Turner db6f5e1933
GH-109975: Copyedit 3.13 What's New: Release Highlights (#122958)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-13 15:30:59 +01:00
Mark Shannon 7a65439b93
GH-122390: Replace `_Py_GetbaseOpcode` with `_Py_GetBaseCodeUnit` (GH-122942) 2024-08-13 14:22:57 +01:00
Mark Shannon fe23f8ed97
GH-122821: Simplify compilation of while statements to ensure consistency of offsets for sys.monitoring (GH-122934) 2024-08-13 10:25:44 +01:00
Brett Cannon 0e207f3e7a
GH-122578: update to WASI SDK 24 (GH-122960) 2024-08-12 16:21:00 -07:00
Brandt Bucher 9621a7d017
GH-118093: Handle some polymorphism before requiring progress in tier two (GH-122843) 2024-08-12 12:39:31 -07:00
Eric Snow 503af8fe9a
gh-117482: Make the Slot Wrapper Inheritance Tests Much More Thorough (gh-122867)
There were a still a number of gaps in the tests, including not looking
at all the builtin types and not checking wrappers in subinterpreters
that weren't in the main interpreter. This fixes all that.

I considered incorporating the names of the PyTypeObject fields
(a la gh-122866), but figured doing so doesn't add much value.
2024-08-12 19:19:33 +00:00
Sam Gross ab094d1b2b
gh-117139: Replace _PyList_FromArraySteal with stack ref variant (#122830)
This replaces `_PyList_FromArraySteal` with `_PyList_FromStackRefSteal`.
It's functionally equivalent, but takes a `_PyStackRef` array instead of
an array of `PyObject` pointers.

Co-authored-by: Ken Jin <kenjin@python.org>
2024-08-12 14:49:49 -04:00
Sam Gross 736fe4d23e
gh-117139: Fix a few `_PyStackRef` related bugs (#122831)
`BUILD_SET` should use a borrow instead of a steal. The cleanup in `_DO_CALL`
`CONVERSION_FAILED` was incorrect.

Co-authored-by: Ken Jin <kenjin@python.org>
2024-08-12 14:49:33 -04:00
Damien be90648fb2
gh-122944: Fix incorrect prompt strings in the Python Tutorial (#122949)
In the REPL, top level comments are followed by a primary, not secondary prompt.
Fix the places in the in the tutorial that use the latter.
2024-08-12 14:30:08 -04:00
Mark Shannon 1795d6ceba
GH-122869: Add missing tier two optimizer cases (GH-122936) 2024-08-12 10:35:52 -07:00
Jelle Zijlstra 53ebb6232a
gh-122888: Fix crash on certain calls to str() (#122889)
Fixes #122888
2024-08-12 09:20:09 -07:00
sobolevn 7c22ab5b38
Fix old-style `print` statement in `gettext` comments (#122939) 2024-08-12 18:15:57 +03:00
Serhiy Storchaka f9ba1f35c7
gh-122688: Add more tests for var-positional parameters in Argument Clinic (GH-122900) 2024-08-12 16:52:48 +03:00
Xie Yanbo 253c6a0b2f
Fix typos in comments and test code (#122846) 2024-08-11 21:16:41 -07:00
Victor Stinner 9375b9ca3a
Remove "print >>obj" exception hint for Python 2 (#122853) 2024-08-12 04:12:14 +00:00
Jason R. Coombs 6aa35f3002
gh-122903: Honor directories in zipfile.Path.glob. (#122908) 2024-08-11 20:33:33 -04:00
Jason R. Coombs 9cd0326310
gh-122905: Sanitize names in zipfile.Path. (#122906)
Ported from zipp 3.19.1; ref jaraco/zipp#119.
2024-08-11 19:48:50 -04:00
Jelle Zijlstra 4534068f22
gh-119180: annotationlib: Fix __all__, formatting (#122365) 2024-08-11 23:44:51 +00:00
Jelle Zijlstra 016f4b5975
gh-119180: Improvements to ForwardRef.evaluate (#122210)
Noticed some issues while writing documentation for this method.
2024-08-11 23:42:57 +00:00
Barney Gale a6644d4464
GH-73991: Rework `pathlib.Path.copytree()` into `copy()` (#122369)
Rename `pathlib.Path.copy()` to `_copy_file()` (i.e. make it private.)

Rename `pathlib.Path.copytree()` to `copy()`, and add support for copying
non-directories. This simplifies the interface for users, and nicely
complements the upcoming `move()` and `delete()` methods (which will also
accept any type of file.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-11 22:43:18 +01:00
sobolevn ea70439bd2
gh-122701: Fix wording of raw strings/bytes in `lexical_analysis.rst` (#122702)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-11 21:02:50 +00:00
Rafael Fontenelle db8b83c2b0
Docs: Standardise versionchanged text in weakref.rst (#122898) 2024-08-11 21:40:11 +01:00
Sam Gross 1069190bad
gh-122860: Remove unused macro `_Py_atomic_load_relaxed_int32` (#122861) 2024-08-11 22:45:02 +05:30
Wulian bc9d92c679
gh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875)
Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-08-11 16:35:51 +00:00
Kumar Aditya 3aaed083a3
GH-120974: make `_asyncio.all_tasks` thread safe (#122801)
Make `_asyncio.all_tasks` thread safe, also changes state lock to use critical section.
2024-08-11 20:49:31 +05:30
Barney Gale 363374cf69
GH-120794: Use example paths with multiple parts in pathlib docs (#122887)
In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*`
equivalents, use example paths with multiple non-anchor parts.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-10 21:21:17 +00:00
Adam Turner 0959142e4d
gh-122868: Add more lower bounds for sphinxcontrib dependencies (#122891) 2024-08-10 20:50:43 +00:00
Nico Mexis 5580f31c56
gh-115808: Add ``is_none`` and ``is_not_none`` to ``operator`` (#115814)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-08-10 20:16:34 +01:00
Adam Turner 0fd97e46c7
gh-122868: Add lower bounds for sphinxcontrib dependencies (#122870)
* Docs: Add lower bounds for sphinxcontrib dependencies

* oops
2024-08-10 01:18:46 +03:00
Victor Stinner d3239976a8
gh-105376: Restore deprecated logging warn() method (#122775)
This reverts commit dcc028d924 and
commit 6c54e5d721.

Keep the deprecated logging warn() method in Python 3.13.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-09 15:13:24 +02:00
Victor Stinner b4a316087c
gh-111495: Fix refleaks in test_capi.test_eval tests (#122851) 2024-08-09 09:47:00 +00:00
Serhiy Storchaka 8393608dd9
gh-122688: Fix support of var-positional parameter in Argument Clinic (GH-122689)
* Parameters after the var-positional parameter are now keyword-only
  instead of positional-or-keyword.
* Correctly calculate min_kw_only.
* Raise errors for invalid combinations of the var-positional parameter
  with "*", "/" and deprecation markers.
2024-08-09 09:22:41 +00:00
Sergey B Kirpichev b6e745a27e
gh-121268: Remove workarounds for non-IEEE 754 systems in cmath (#122716)
As now building Python now requires support of IEEE 754 floating point
numbers.
2024-08-09 11:17:40 +02:00
Malcolm Smith 2f5c3b09e4
gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764)
(LIBPYTHON was renamed MODULE_LDFLAGS in commit 7f5e3f04f.)
2024-08-09 00:00:55 +02:00
Miro Hrončok 8c9d1742de
GH-118943: Remove regen-jit from the regen-all make target (GH-122602)
Co-authored-by: Éric <merwok@netwok.org>
2024-08-08 13:34:42 -07:00
Nate Ohlson aab18f4d92
gh-112301: Update documentation for configure options (``--disable-safety`` and ``--enable-slower-safety``) (#122758)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-08 20:35:00 +01:00
Kirill Podoprigora 2037d8cbae
gh-122835: Fix module name in ``test_typing`` (#122836) 2024-08-08 19:26:31 +00:00
Sam Gross 2d9d3a9f53
gh-122697: Fix free-threading memory leaks at shutdown (#122703)
We were not properly accounting for interpreter memory leaks at
shutdown and had two sources of leaks:

 * Objects that use deferred reference counting and were reachable via
   static types outlive the final GC. We now disable deferred reference
   counting on all objects if we are calling the GC due to interpreter
   shutdown.

 * `_PyMem_FreeDelayed` did not properly check for interpreter shutdown
   so we had some memory blocks that were enqueued to be freed, but
   never actually freed.

 * `_PyType_FinalizeIdPool` wasn't called at interpreter shutdown.
2024-08-08 12:48:17 -04:00
Irit Katriel 833eb106f5
gh-122562: fix dump_symtable for ste_free and ste_child_free removal (#122825) 2024-08-08 14:03:45 +01:00
Victor Stinner bf8b374639
gh-111495: Add more tests on PyEval C APIs (#122789)
* Add Lib/test/test_capi/test_eval.py
* Add Modules/_testlimitedcapi/eval.c
2024-08-08 14:16:20 +02:00
Mark Shannon 81c739e2dc
GH-120024: Tidy up case generator code a bit. (GH-122780) 2024-08-08 10:57:59 +01:00
Petr Viktorin 0d9c123d1a
gh-122744: test_venv: ignore pip's complaint about missing ssl (GH-122776) 2024-08-08 11:20:58 +02:00
Francisco Kurucz acf0d9eae6
InternalDocs: Fix typo in link to instruction_sequence.c inside compiler docs (#122809) 2024-08-08 09:19:10 +01:00
Serhiy Storchaka fe13c9baf4
gh-122255: Add black box tests in test_warnings (GH-122227)
They are similar to white box tests for gh-86298 in test_importlib.
2024-08-08 10:35:47 +03:00