Commit graph

124760 commits

Author SHA1 Message Date
Hood Chatham
1183e4ce2f
gh-127146: Emscripten clean up test suite (#127984)
Removed test skips that are no longer required as a result of Emscripten updates.
2024-12-17 07:48:23 +00:00
Berker Peksag
cfeaa992ba
Free arena on _PyCompile_AstOptimize failure in Py_CompileStringObject (GH-127910)
After commit 10a91d7e9 introduced arena cleanup, commit 2dfbd4f36
removed the free call when _PyCompile_AstOptimize fails.
2024-12-16 22:59:36 +02:00
Peter Bierma
3b766824fe
gh-126907: make atexit thread safe in free-threading (#127935)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-12-16 19:31:44 +00:00
Edward Xu
4937ba54c0
gh-127085: fix some data races in memoryview in free-threading (#127412) 2024-12-17 00:42:19 +05:30
Hugo van Kemenade
1d276ec6f8
Revert "gh-127586: properly restore blocked signals in resource_tracker.py (GH-127587)" (#127983)
This reverts commit 46006a1b35.
2024-12-16 20:18:02 +02:00
Gugubo
e4981e33b8
Fix typo in itertools docs (gh-127995) 2024-12-16 11:08:25 -06:00
Tomas R.
081673801e
gh-127864: Fix compiler warning (-Wstringop-truncation) (GH-127878) 2024-12-16 11:57:18 -05:00
Yuki Kobayashi
52d552cda7
gh-127896: Add missing documentation of PySequence_In (GH-127979)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-12-16 14:56:04 +01:00
Bénédikt Tran
0d8e7106c2
gh-111178: fix UBSan failures in _elementtree.c (#127982) 2024-12-16 14:40:26 +01:00
Pablo Galindo Salgado
47c5a0f307
gh-125588: Allow to regenerate the parser with Python < 3.12 (#127969)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2024-12-15 23:17:01 +00:00
Filipe Laíns 🇵🇸
b74c8f58e8
GH-126985: Don't override venv detection with PYTHONHOME (#127968) 2024-12-15 21:12:13 +00:00
Stephen Hansen
46006a1b35
gh-127586: properly restore blocked signals in resource_tracker.py (GH-127587)
* Correct pthread_sigmask in resource_tracker to restore old signals

Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally
cause side effects if the calling parent already had said signals
blocked to begin with and did not intend to unblock them when
creating a pool. Use SIG_SETMASK instead with the previous mask of
blocked signals to restore the original blocked set.

* Adding resource_tracker blocked signals test

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-12-15 11:53:22 -08:00
Stan Ulbrych
7b8bd3b2b8
gh-119786: Fix miscellaneous typos in InternalDocs/interpreter_definition.md (#127957) 2024-12-15 19:11:50 +02:00
Filipe Laíns 🇵🇸
3683b2f9e5
getpath: Add comments highlighing details of the pyvenv.cfg detection (#127966) 2024-12-15 15:40:19 +00:00
Ed Nutting
ab05beb8ce
gh-127599: Fix _Py_RefcntAdd missing calls to _Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC (#127717)
Previously, `_Py_RefcntAdd` hasn't called 
`_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect. 

Now it has been fixed.
2024-12-15 15:51:03 +02:00
Steve C
7900a85019
Clarify ast docs to use a less confusing example for ast.ParamSpec (#127955)
Fix typo in ast docs: ParamSpec defaults
2024-12-15 12:28:43 +00:00
Andrey Efremov
0ac40acec0
gh-127353: Allow to force color output on Windows V2 (#127926) 2024-12-14 17:25:49 +02:00
Sergey B Kirpichev
e2325c9db0
gh-127852: add remark about ',' separator (#127854)
Specify that it is valid for floats and ints with 'd' presentation and an error otherwise.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-12-14 08:28:26 -05:00
Totosuki
78e766f2e2
Fix typo in docstring: quadruple double quotes (#127913) 2024-12-13 23:38:54 -08:00
Cody Maloney
c0264fc57c
gh-127747: Resolve BytesWarning in test.support.strace_helper (#127849)
The strace_helper code has a _make_error function to simplify making
StraceResult objects in error cases. That takes a details parameter
which is either a caught OSError or `bytes`. If it's bytes, _make_error
would implicitly coerce that to a str inside of a f-string, resulting in
 a BytesWarning.

It's useful to see if it's an OSError or bytes when debugging, resolve
by changing to format with repr().

This is an error message on an internal helper.

A non-zero exit code occurs if the strace binary isn't found, and no
events will be parsed in that case (there is no output). Handle that
case by checking exit code before checking for events.

Still asserting around events rather than returning false, so that
hopefully if there's some change to `strace` that breaks the parsing,
will see that as a test failure rather than silently loosing strace
tests because they are auto-disabled.
2024-12-13 23:36:47 -08:00
mpage
2de048ce79
gh-115999: Specialize loading attributes from modules in free-threaded builds (#127711)
We use the same approach that was used for specialization of LOAD_GLOBAL in free-threaded builds:

_CHECK_ATTR_MODULE is renamed to _CHECK_ATTR_MODULE_PUSH_KEYS; it pushes the keys object for the following _LOAD_ATTR_MODULE_FROM_KEYS (nee _LOAD_ATTR_MODULE). This arrangement avoids having to recheck the keys version.

_LOAD_ATTR_MODULE is renamed to _LOAD_ATTR_MODULE_FROM_KEYS; it loads the value from the keys object pushed by the preceding _CHECK_ATTR_MODULE_PUSH_KEYS at the cached index.
2024-12-13 10:17:16 -08:00
Raymond Hettinger
292067fbc9
Minor readability improvements for the itertools recipes (gh-127928) 2024-12-13 12:12:49 -06:00
Inada Naoki
5dd775bed0
gh-126024: unicodeobject: optimize find_first_nonascii (GH-127790)
Remove 1 branch.
2024-12-13 17:21:46 +01:00
Bénédikt Tran
8bc18182a7
gh-127691: add type checks when using PyUnicodeError objects (GH-127694) 2024-12-13 17:16:22 +01:00
Victor Stinner
6446408d42
gh-102471, PEP 757: Add PyLong import and export API (#121339)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-13 14:24:48 +01:00
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