Commit graph

125635 commits

Author SHA1 Message Date
Victor Stinner
d05a4e6a0d
gh-127906: Test the limited C API in test_cppext (#127916) 2024-12-13 13:23:20 +00:00
Victor Stinner
6ff38fc4e2
gh-127870: Detect recursive calls in ctypes _as_parameter_ handling (#127872) 2024-12-13 13:53:47 +01:00
Mark Shannon
e62e1ca455
GH-126833: Dumps graphviz representation of executor graph. (GH-126880) 2024-12-13 11:00:00 +00:00
Pieter Eendebak
5fc6bb2754
gh-126868: Add freelist for compact int objects (GH-126865) 2024-12-13 10:06:26 +00:00
Mark Shannon
9b4bbf4401
GH-125174: Don't use UINT32_MAX in header file (GH-127863) 2024-12-13 10:54:59 +01:00
Viktor Kálmán
11ff3286b7
link to the correct output method in documentation (#127857) 2024-12-13 14:57:02 +05:30
Miro Hrončok
58942a07df
Document PyObject_SelfIter (#127861) 2024-12-13 14:56:22 +05:30
Russell Keith-Magee
ba2d2fda93
gh-127845: Minor improvements to iOS test runner script (#127846)
Uses symlinks to install iOS framework into testbed clone, adds a verbose mode
to the iOS runner to hide most Xcode output, adds another mechanism to disable
terminal colors, and ensures that stdout is flushed after every write.
2024-12-13 05:49:02 +08:00
Daniel Haag
0cbc19d59e
Fix typo in traceback docs (#127884) 2024-12-12 21:43:44 +00:00
Filipe Laíns 🇵🇸
8ac307f0d6
GH-127724: don't use sysconfig to calculate the venv local include path (#127731) 2024-12-12 21:41:46 +00:00
Hugo van Kemenade
a8ffe66154
Revert "gh-127353: Allow to force color output on Windows (#127354)" (#127889)
This reverts commit 365451e283.
2024-12-12 21:11:20 +00:00
Stan Ulbrych
ed037d229f
Fix typos in Lib/_pydecimal.py (#127700) 2024-12-12 22:27:29 +02:00
Andrey Efremov
365451e283
gh-127353: Allow to force color output on Windows (#127354) 2024-12-12 22:17:39 +02:00
velemas
f823910bbd
gh-127865: Fix build failure for systems without thread local support (GH-127866)
This PR fixes the build issue introduced by the commit 628f6eb from
GH-112207 on systems without thread local support.
2024-12-12 13:07:55 -05:00
Sam Gross
f8dcb82006
gh-127879: Fix data race in _PyFreeList_Push (#127880)
Writes to the `ob_tid` field need to use atomics because it may be
concurrently read by a non-locking dictionary, list, or structmember
read.
2024-12-12 12:59:13 -05:00
Barney Gale
7146f18946
GH-127807: pathlib ABCs: remove PathBase._unsupported_msg() (#127855)
This method helped us customise the `UnsupportedOperation` message
depending on the type. But we're aiming to make `PathBase` a proper ABC
soon, so `NotImplementedError` is the right exception to raise there.
2024-12-12 17:39:24 +00:00
Mark Shannon
487fdbed40
GH-125174: Fix compiler warning (GH-127860)
Fix compiler warning
2024-12-12 11:22:20 +00:00
Barney Gale
292afd1d51
GH-127381: pathlib ABCs: remove remaining uncommon PathBase methods (#127714)
Remove the following methods from `pathlib._abc.PathBase`:

- `expanduser()`
- `hardlink_to()`
- `touch()`
- `chmod()`
- `lchmod()`
- `owner()`
- `group()`
- `from_uri()`
- `as_uri()`

These operations aren't regularly supported in virtual filesystems, so they
don't win a place in the `PathBase` interface. (Some of them probably don't
deserve a place in `Path` :P.) They're quasi-abstract (except `lchmod()`),
and they're not called by other `PathBase` methods.
2024-12-12 06:49:34 +00:00
Raymond Hettinger
8bbd379ee3
Simplify and speed-up an itertools recipe (gh-127848) 2024-12-11 21:24:56 -06:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
c33b6fbf35
gh-127740: Add some more tests for earlier PR #127756 (#127818) 2024-12-12 02:18:12 +00:00
Hood Chatham
41f29e5d16
gh-127146: Some expected failures in Emscripten time tests (#127843)
Disables two tests in the test_time suite, and adjusts test_os to reflect 
precision limits in Emscripten.
2024-12-12 09:11:00 +08:00
mpage
c84928ed6d
gh-115999: Specialize CALL_KW in free-threaded builds (#127713)
* Enable specialization of CALL_KW

* Fix bug pushing frame in _PY_FRAME_KW

`_PY_FRAME_KW` pushes a pointer to the new frame onto the stack for
consumption by the next uop. When pushing the frame fails, we do not
want to push the result, `NULL`, to the stack because it is not
a valid stackref. This works in the default build because `PyStackRef_NULL`
 and `NULL` are the same value, so the `PyStackRef_XCLOSE()` in the error
handler ignores it. In the free-threaded build the values are not the same;
`PyStackRef_XCLOSE()` will attempt to decref a null pointer.
2024-12-11 15:18:22 -08:00
Nice Zombies
e8f4e272cc
gh-111609: Test end_offset in SyntaxError subclass (#127830)
Test `end_offset` in SyntaxError subclass
2024-12-11 19:32:54 +01:00
Mark Shannon
bc262de06b
GH-125174: Mark objects as statically allocated. (#127797)
* Set a bit in the unused part of the refcount on 64 bit machines and the free-threaded build.

* Use the top of the refcount range on 32 bit machines
2024-12-11 17:37:38 +00:00
Peter Bierma
dd9da738ad
gh-118915: C API: Document frame locals proxies. (#127720)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-12-11 17:28:44 +01:00
Pieter Eendebak
b0f278ff05
gh-127065: Make methodcaller thread-safe and re-entrant (GH-127746)
The function `operator.methodcaller` was not thread-safe since the additional
of the vectorcall method in gh-89013. In the free threading build the issue
is easy to trigger, for the normal build harder.

This makes the `methodcaller` safe by:

* Replacing the lazy initialization with initialization in the constructor.
* Using a stack allocated space for the vectorcall arguments and falling back
  to `tp_call` for calls with more than 8 arguments.
2024-12-11 10:06:07 -05:00
Mark Shannon
5a23994a3d
GH-127058: Make PySequence_Tuple safer and probably faster. (#127758)
* Use a small buffer, then list when constructing a tuple from an arbitrary sequence.
2024-12-11 14:02:59 +00:00
Nano
359389ed51
gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (#123405)
Co-authored-by: Wulian <1055917385@qq.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-11 13:28:19 +00:00
Hugo van Kemenade
b2ad7e0a2c
CI: Use bash to properly expand variable (#127822) 2024-12-11 12:57:51 +00:00
Justin Applegate
ce76b547f9
gh-126992: Change pickle code to base 10 for load_long and load_int (GH-127042)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-12-11 12:37:59 +00:00
Peter Bierma
d5d84c3f13
gh-127791: Fix, document, and test PyUnstable_AtExit (#127793) 2024-12-11 12:14:04 +01:00
Peter Hawkins
2cdeb61b57
Add extern "C" around PyTraceMalloc_ functions. (#127772)
Pretty much everything else exported by Python.h has an extern "C"
annotation, yet this header appears to be missing one.
2024-12-11 10:27:07 +01:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
db9bea0386
gh-127740: For odd-length input to bytes.fromhex(...) change the error message to ValueError: fromhex() arg must be of even length (#127756) 2024-12-11 08:35:17 +01:00
Barney Gale
12b4f1a5a1
GH-127381: pathlib ABCs: remove PathBase.samefile() and rarer is_*() (#127709)
Remove `PathBase.samefile()`, which is fairly specific to the local FS, and
relies on `stat()`, which we're aiming to remove from `PathBase`.

Also remove `PathBase.is_mount()`, `is_junction()`, `is_block_device()`,
`is_char_device()`, `is_fifo()` and `is_socket()`. These rely on POSIX
file type numbers that we're aiming to remove from the `PathBase` API.
2024-12-11 00:09:55 +00:00
Russell Keith-Magee
51216857ca
gh-126821: Add versionadded annotation to use_system_logger feature. (#127755)
Add versionadded annotation to use_system_logger feature.
2024-12-11 05:32:04 +08:00
Yuki Kobayashi
035f512046
Docs: Fix indents in xmlrpc.client.rst (#127782) 2024-12-10 19:35:00 +02:00
Victor Stinner
c91ccbe4ac
gh-59705: Set OS thread name when Thread.name is changed (#127702)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-12-10 17:33:11 +01:00
Bénédikt Tran
9af96f4406
gh-127563: use dk_log2_index_bytes=3 in empty dicts (GH-127568)
This fixes a UBSan failure (unaligned zero-size memcpy) in `dictobject.c`.
2024-12-10 16:58:17 +01:00
Melissa0x1f992
cef0a90d8f
gh-126937: ctypes: fix TypeError when a field's size is >65535 bytes (GH-126938)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-12-10 13:13:11 +01:00
Petr Viktorin
f4b31edf2d
gh-127257: ssl: Raise OSError for ERR_LIB_SYS (GH-127361)
From the ERR_raise manpage:

    ERR_LIB_SYS

        This "library code" indicates that a system error is
        being reported.  In this case, the reason code given
        to `ERR_raise()` and `ERR_raise_data()` *must* be
        `errno(3)`.


This PR only handles ERR_LIB_SYS for the high-lever error types
SSL_ERROR_SYSCALL and SSL_ERROR_SSL, i.e., not the ones where
OpenSSL indicates it has some more information about the issue.
2024-12-10 11:56:24 +01:00
Petr Viktorin
690fe077f6
gh-126491: Revert "GH-126491: Lower heap size limit with faster marking (GH-127519)" (GH-127770)
Revert "GH-126491: Lower heap size limit with faster marking (GH-127519)"

This reverts commit 023b7d2141, which introduced
a refleak.
2024-12-10 11:53:56 +01:00
Hugo van Kemenade
ae31df354d
Add zizmor to pre-commit and fix most findings (#127749)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-12-10 12:51:12 +02:00
Yuki Kobayashi
8dbdbad6e0
gh-101100: Fix sphinx warnings in whatsnew/3.0.rst (#127662) 2024-12-10 12:22:37 +02:00
Bénédikt Tran
4331832db0
gh-125420: implement Sequence.count API on memoryview objects (#125443) 2024-12-10 10:12:33 +00:00
Skip Montanaro
050d59bd17
add help blurb for "extralargefile" (#127710) 2024-12-10 09:17:25 +01:00
Hugo van Kemenade
212448b162
gh-127718: Add colour to test.regrtest output (#127719) 2024-12-10 09:44:15 +02:00
Thomas Grainger
2233c303e4
gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (#126776)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
2024-12-10 08:40:54 +01:00
Shantanu
3983527c3a
gh-127651: Use __file__ in diagnostics if origin is missing (#127660)
See the left hand side in https://github.com/python/cpython/pull/123929/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59deL2840-L2849

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-12-09 20:55:20 -08:00
Bénédikt Tran
58c753827a
gh-125420: implement Sequence.index API on memoryview objects (#125446) 2024-12-09 18:48:38 -08:00
Hood Chatham
3b18af964d
gh-127629: Add ctypes to the Emscripten build (#127683)
Adds tooling to build libffi and add ctypes to the stdlib for Emscripten.
2024-12-10 10:32:58 +08:00