Commit Graph

123462 Commits

Author SHA1 Message Date
Irit Katriel e077b201f4
gh-121404: pass metadata to compiler_enter_scope (optionally) so that codegen functions don't need to set it on the code unit (#123078) 2024-08-19 11:49:42 +01:00
Sergey B Kirpichev b9e10d1a0f
gh-122081: fixed crash in decimal.IEEEContext() (#122082)
* gh-122081: fixed crash in decimal.IEEEContext()

Now

$ ./configure CFLAGS=-DEXTRA_FUNCTIONALITY -q && make -s && \
     ./python -m test test_decimal

- PASS

* Apply suggestions from code review

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Update Misc/NEWS.d/next/Library/2024-07-21-10-45-24.gh-issue-122081.dNrYMq.rst

* Apply suggestions from code review

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-08-19 07:51:38 +00:00
Pedro Lacerda be257c5815
gh-123049: configparser: Allow to create the unnamed section from scratch. (#123077)
---------

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-08-18 15:52:25 -04:00
sobolevn c15bfa9a71
gh-116789: Add more tests for `inspect.getmembers` (#116802) 2024-08-18 18:42:56 +03:00
Sergey B Kirpichev b0f462d4c8
gh-123110: correct note about _Bool in the struct module docs (GH-123111) 2024-08-18 16:58:58 +03:00
CF Bolz-Tereick 63603bca35
gh-82378 fix sys.tracebacklimit in pyrepl, approach 2 (#123062)
Make sure that pyrepl uses the same logic for sys.tracebacklimit as both
the basic repl and the standard sys.excepthook
2024-08-18 13:28:23 +02:00
Adam Turner 79c542b5cc
Docs: Run ``latexmk`` in parallel when creating PDFs (#123113) 2024-08-17 20:58:06 +00:00
Sam Gross d061ffea7b
gh-123022: Fix crash with `Py_Initialize` in background thread (#123052)
Check that the current default heap is initialized in
`_mi_os_get_aligned_hint` and `mi_os_claim_huge_pages`.

The mimalloc function `_mi_os_get_aligned_hint` assumes that there is an
initialized default heap. This is true for our main thread, but not for
background threads. The problematic code path is usually called during
initialization (i.e., `Py_Initialize`), but it may also be called if the
program allocates large amounts of memory in total.

The crash only affected the free-threaded build.
2024-08-17 16:04:08 -04:00
Sam Gross 40632b1f1d
gh-122974: Suppress GCC array bound warnings in free-threaded build (#123071)
GCC 11 and newer warn about the access to `unique_id` in non-debug builds
due to inlining the call on static non-heap types.
2024-08-17 16:03:50 -04:00
Serhiy Storchaka 44e458357f
gh-123067: Fix quadratic complexity in parsing "-quoted cookie values with backslashes (GH-123075)
This fixes CVE-2024-7592.
2024-08-17 16:30:52 +03:00
Adam Turner d60b97a833
GH-109975: Copyedit 3.13 What's New: Other Language Changes (#123086)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-17 12:09:42 +00:00
Sergey B Kirpichev ce4b9c8464
gh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString() (#121478)
* gh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString()

* Update Doc/c-api/long.rst

---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-08-17 09:13:31 +00:00
mathysEthical e9287ea426
fix typo in dis.rst (#121612) 2024-08-17 14:20:58 +05:30
Rafael Fontenelle 26de1b245e
Remove unneeded verb in the phrase in sys.rst (#122718) 2024-08-17 14:18:31 +05:30
Damien 8a59deca59
gh-122519: Adding socket module shutdown() constants description (#122543) 2024-08-17 13:59:23 +05:30
Sergey B Kirpichev 19be0ee931
gh-122681: remove m_atan2()/c_atan2() helpers (#122715) 2024-08-17 13:48:16 +05:30
Kirill Podoprigora e6d5ff55d0
gh-123087: ``Lib/test/test_unittest/testmock/testasync.py``: Replace usage of the deprecated ``asyncio.iscoroutinefunction`` with the ``inspect.iscoroutinefunction`` (#123088)
asyncio.iscoroutinefunction -> inspect.iscoroutinefunction
2024-08-17 11:03:51 +03:00
Cody Maloney 35d8ac7cd7
GH-120754: Disable buffering in Path.read_bytes (#122111)
`Path.read_bytes()` is used to read a whole file. buffering /
BufferedIO is focused around making small, possibly interleaved,
read/write efficient which doesn't add value in this case.

On my Mac, running the benchmark:

```python
import pyperf
from pathlib import Path

def read_all(all_paths):
    for p in all_paths:
        p.read_bytes()

def read_file(path_obj):
    path_obj.read_bytes()

all_rst = list(Path("Doc").glob("**/*.rst"))
all_py = list(Path(".").glob("**/*.py"))
assert all_rst, "Should have found rst files"
assert all_py, "Should have found python source files"

runner = pyperf.Runner()
runner.bench_func("read_file_small", read_file, Path("Doc/howto/clinic.rst"))
runner.bench_func("read_file_large", read_file, Path("Doc/c-api/typeobj.rst"))
```

before:
```python
.....................
read_file_small: Mean +- std dev: 6.80 us +- 0.07 us
.....................
read_file_large: Mean +- std dev: 10.8 us +- 0.2 us
````

after:
```python
.....................
read_file_small: Mean +- std dev: 5.67 us +- 0.05 us
.....................
read_file_large: Mean +- std dev: 9.77 us +- 0.52 us
```
2024-08-16 13:52:41 -07:00
Mateusz Nowak 8ef358dae1
gh-118658: Return consistent types from `get_un/verified_chain` in `SSLObject` and `SSLSocket` (#118669)
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2024-08-16 22:27:44 +02:00
Mark Shannon c13e7d98fb
GH-118093: Specialize `CALL_KW` (GH-123006) 2024-08-16 17:11:24 +01:00
Irit Katriel e2f2dc708e
gh-121404: rename compiler_addop* to codegen_addop*, and replace direct usages by the macros (#123043) 2024-08-16 15:57:32 +01:00
CF Bolz-Tereick a07cf4ce25
mention pypy somewhat more prominently in the pyrepl section of whatsnew (#123063) 2024-08-16 11:38:44 +00:00
Kirill Podoprigora 786cac0c64
gh-123046: Fix regexp to catch cases where the module name is omitted from the weakref repr (#123047)
Co-authored-by: sobolevn <mail@sobolevn.me>
2024-08-16 07:14:53 +00:00
Malcolm Smith f84cce6f25
gh-116622: Add Android test script (#121595)
Adds a script for running the test suite on Android emulator devices. Starting
with a fresh install of the Android Commandline tools; the script manages
installing other requirements, starting the emulator (if required), and
retrieving results from that emulator.
2024-08-16 13:00:29 +08:00
Jason R. Coombs e913d2c87f
gh-116608: Apply style and compatibility changes from importlib_metadata. (#123028) 2024-08-15 15:32:05 -04:00
Pablo Galindo Salgado d7a3df9150
Add debug offsets for free threaded builds (#123041) 2024-08-15 18:42:41 +00:00
Brett Cannon b15b81ed4f
GH-121634: have `wasi.py` accept the host target triple as an argument (GH-123030) 2024-08-15 10:30:08 -07:00
Sam Gross e001027188
gh-117139: Garbage collector support for deferred refcounting (#122956)
The free-threaded GC now visits interpreter stacks to keep objects
that use deferred reference counting alive.

Interpreter frames are zero initialized in the free-threaded GC so
that the GC doesn't see garbage data. This is a temporary measure
until stack spilling around escaping calls is implemented.

Co-authored-by: Ken Jin <kenjin@python.org>
2024-08-15 16:09:11 +00:00
Michael Droettboom 1dad23edbc
gh-122584: Import mimalloc headers in a C++ context (#122587) 2024-08-15 09:01:01 -04:00
Eddie Elizondo 3203a74129
gh-113190: Reenable non-debug interned string cleanup (GH-113601) 2024-08-15 11:55:09 +00:00
Irit Katriel b6cb435ac0
gh-121404: split compiler's push/pop_inlined_comprehension_state into codegen and compiler parts (#123021) 2024-08-15 11:08:54 +00:00
Malcolm Smith 3950392f48
gh-99108: Inform HACL when explicit_bzero is unavailable (GH-123027)
Inform HACL whether explicit_bzero is available
2024-08-15 11:43:34 +02:00
Adam Turner b106cf8d97
GH-109975: Copyedit 3.13 What's New: New Features (#122990)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2024-08-15 10:08:15 +01:00
Rafael Fontenelle 1054a755a3
GH-103484: Tell linkcheck to ignore debian manpage redirects (#123019) 2024-08-14 22:35:23 +01:00
Nate Ohlson 1cf624be6d
gh-112301: Add warning count to warning check tooling (#122711)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-15 00:03:53 +03:00
Damien 8e2dc7f380
gh-123005: Add version added in enum.Flag.__len__ (GH-123007) 2024-08-14 13:30:33 -07:00
Brandt Bucher f84754b705
GH-118093: Turn some DEOPT_IFs into EXIT_IFs (GH-122998) 2024-08-14 07:54:42 -07:00
Brandt Bucher 51185923a8
GH-113464: Speed up JIT builds (GH-122839) 2024-08-14 07:53:46 -07:00
sobolevn 6ae942f412
gh-122965: Fix `reusable-change-detection.yml` on `workflow_dispatch` (#122966) 2024-08-14 15:05:39 +03:00
Mark Shannon eec7bdaf01
GH-120024: Remove `CHECK_EVAL_BREAKER` macro. (GH-122968)
* Factor some instructions into micro-ops to isolate CHECK_EVAL_BREAKER for escape analysis

* Eliminate CHECK_EVAL_BREAKER macro
2024-08-14 12:04:05 +01:00
Rafael Fontenelle 315a933a5b
Fix doctrees directory for the gettext builder (#122997) 2024-08-14 11:38:29 +01:00
Bénédikt Tran fe3e623562
gh-111178: Avoid calling long_hash from incompatible pointer type (GH-122972)
Make `long_hash` compatible with `hashfunc`.
2024-08-14 11:50:35 +02:00
Irit Katriel 05fc4d758a
gh-122985: add SYMBOL_TO_SCOPE macro in symtable (#122986) 2024-08-14 06:17:04 +01:00
Russell Keith-Magee e03073ff20
Ensure that iOS test re-runs don't try to spawn a process. (#122994)
Adds the --single-process option to the iOS test runner to ensure re-runs execute in the same process.
2024-08-14 09:46:53 +08:00
Russell Keith-Magee ce39d3c6bd
Add a --rerun option to the iOS testbed. (#122992)
Enable --rerun when running tests on iOS.
2024-08-14 08:14:33 +08:00
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