Commit Graph

121198 Commits

Author SHA1 Message Date
Serhiy Storchaka
f97f25ef5d
gh-76511: Fix email.Message.as_string() for non-ASCII message with ASCII charset (GH-116125) 2024-03-05 17:49:01 +02:00
Serhiy Storchaka
df59401108
Fix the PyGetSetDef documentation (GH-116056)
closure is not a function pointer, it is a user data pointer.
2024-03-05 17:48:20 +02:00
Serhiy Storchaka
0064dfa091
gh-115777: Fix double versionadded directives (GH-116269) 2024-03-05 17:41:53 +02:00
Mark Shannon
23db9c6227
GH-115685: Split _TO_BOOL_ALWAYS_TRUE into micro-ops (GH-116352) 2024-03-05 15:23:08 +00:00
Mark Shannon
0c81ce1360
GH-115819: Eliminate Boolean guards when value is known (GH-116355) 2024-03-05 15:06:00 +00:00
Nikita Sobolev
c91bdf86ef
gh-116326: Handler errors correctly in getwindowsversion in sysmodule (#116339) 2024-03-05 12:31:04 +00:00
Mark Shannon
cbf3d38cbe
GH-115685: Optimize TO_BOOL and variants based on truthiness of input. (GH-116311) 2024-03-05 11:23:46 +00:00
Nikita Sobolev
a29998a06b
gh-116325: Raise SyntaxError rather than IndexError on ForwardRef with empty string arg (#116341) 2024-03-05 09:14:18 +00:00
Dino Viehland
ffcc450a9b
gh-112075: Enable freeing with qsbr and fallback to lock on key changed (GH-116336) 2024-03-05 09:08:18 +00:00
Brett Cannon
7af063d1d8
GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives (#116327)
* GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives

* Add the configure changes

* Update `wasm_build.py`
2024-03-05 09:18:53 +01:00
Donghee Na
6cddc731fb
gh-112087: Make list_{slice, ass_slice, subscript} to be threadsafe (gh-116233) 2024-03-05 04:58:14 +00:00
Sam Gross
58c7919d05
gh-116029: Fix unused function warning on macOS (#116340) 2024-03-04 22:06:21 -05:00
Terry Jan Reedy
88b5c665ee
gh-116265: Remove obsolete sentence. (#116284)
Remove sentence in Tools/c-analyzer/README referring to deleted
ignore-globals.txt.
2024-03-04 16:49:42 -05:00
Eric Snow
eb22e2b251
gh-115490: Make the interpreter.channels and interpreter.queues Modules Handle Reloading Properly (gh-115493)
The problem manifested when the .py module got reloaded and the corresponding extension module didn't. The .py module registers types with the extension and the extension was not allowing that to happen more than once. The solution: let it happen more than once.
2024-03-04 20:59:30 +00:00
Nikita Sobolev
207030f552
gh-115320: Refactor get_hash_info in sysmodule.c not to swallow errors (#115321) 2024-03-04 23:03:59 +03:00
Eric Snow
01440d3a39
gh-76785: Simplify Channels XID Types (gh-116318)
I had added an extra cleanup abstraction a while back that has turned out to be unnecessary.
2024-03-04 19:32:39 +00:00
Brandt Bucher
ffed8d985b
GH-116134: JIT aarch64-pc-windows-msvc (GH-116130) 2024-03-04 10:16:56 -08:00
Brandt Bucher
981f27dcc4
GH-115802: Don't JIT zero-length jumps (GH-116177) 2024-03-04 10:13:10 -08:00
Kirill Podoprigora
8a84eb75a9
gh-116316: Fix typo in UNARY_FUNC(PyNumber_Positive) macros (GH-116317) 2024-03-04 17:57:01 +00:00
Tobias Rautenkranz
60743a9a7e
gh-57141: Add dircmp shallow option (GH-109499)
Co-authored-by: Steve Ward <planet36@gmail.com>
Co-authored-by: Sanyam Khurana <8039608+CuriousLearner@users.noreply.github.com>
2024-03-04 17:27:43 +00:00
Sergey B Kirpichev
ea1b1c579f
gh-108562: Revert enabling -fstrict-overflow for libmpdec (GH-116302)
gh-108562: partial reversion of pr114751

Reverts -fstrict-overflow for libmpdec
2024-03-04 18:07:24 +01:00
Yuriy Chernyshov
9b9e819b51
gh-116116: Backport blake2 change to fix building with clang-cl on windows-i686 (GH-116117) 2024-03-04 16:59:57 +00:00
Brett Simmers
0adfa8482d
gh-115832: Fix instrumentation version mismatch during interpreter shutdown (#115856)
A previous commit introduced a bug to `interpreter_clear()`: it set
`interp->ceval.instrumentation_version` to 0, without making the corresponding
change to `tstate->eval_breaker` (which holds a thread-local copy of the
version). After this happens, Python code can still run due to object finalizers
during a GC, and the version check in bytecodes.c will see a different result
than the one in instrumentation.c causing an infinite loop.

The fix itself is straightforward: clear `tstate->eval_breaker` when clearing
`interp->ceval.instrumentation_version`.
2024-03-04 11:29:39 -05:00
Raymond Hettinger
15dc2979bc
Consistently spell out *predicate* instead of *pred*. (gh-116308) 2024-03-04 15:51:29 +00:00
pan324
0dfa7ce346
gh-115256: Remove refcycles from tarfile writing (GH-115257) 2024-03-04 13:26:32 +00:00
Erlend E. Aasland
cfbdce7208
gh-114258: Argument Clinic: refactor getset implementation (#116170)
* Move param guard to param state machine
* Override return converter during parsing
* Don't use a custom type slot return converter; instead
  special case type slot functions during generation.
2024-03-04 13:51:28 +01:00
Kerim Kabirov
45a92436c5
GH-116271 Docs: provide clarification for object assignments in the Tutorial section (#116283)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-04 12:22:13 +00:00
Gregory P. Smith
eda2963378
gh-115398: Increment PyExpat_CAPI_MAGIC for SetReparseDeferralEnabled addition (GH-116301)
* Increment PyExpat_CAPI_MAGIC due to SetReparseDeferralEnabled addition.

This is a followup to git commit
6a95676bb5 from Github PR #115623.

* RESTify news API list.
2024-03-04 10:36:27 +00:00
Erlend E. Aasland
17c4849981
gh-116296: Fix refleak in reduce_newobj() corner case (#116297)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2024-03-04 09:46:18 +00:00
Barney Gale
1dce0073da
pathlib ABCs: follow all symlinks in PathBase.glob() (#116293)
Switch the default value of *follow_symlinks* from `None` to `True` in
`pathlib._abc.PathBase.glob()` and `rglob()`. This speeds up recursive
globbing.

No change to the public pathlib classes.
2024-03-04 02:26:33 +00:00
Iman Tabrizian
3383d6afa3
gh-116010: Remove link to deprecated PEP 6 in FAQ guide (#116246)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-03 12:50:18 -07:00
HarryLHW
4859ecb860
gh-116281: Remove wrong '\' from '\*' in some doc signatures (#116282) 2024-03-03 14:32:32 -05:00
Hugo van Kemenade
4d3ee77aef
Docs: update using/configure.rst (#116274) 2024-03-03 08:40:02 -07:00
Serhiy Storchaka
87faec28c7
gh-115809: Improve TimedRotatingFileHandler.getFilesToDelete() (GH-115812)
Improve algorithm for computing which rolled-over log files to delete
in logging.TimedRotatingFileHandler. It is now reliable for handlers
without namer and with arbitrary deterministic namer that leaves
the datetime part in the file name unmodified.
2024-03-03 09:42:08 +02:00
Sergey B Kirpichev
002a5948fc
gh-108562: Fix compiler warnings for libmpdec (#114751)
If awailable, enable -fstrict-overflow for libmpdec. Also
shut off false positive warnings (-Warray-bounds).

The later was backported from mpdecimal-4.0.0.
2024-03-03 08:25:39 +01:00
Gouvernathor
67f742e03a
gh-72971: Clarify the special no-TypeError behavior for equality (#110729) 2024-03-03 00:45:48 +00:00
Donghee Na
d1fd060659
gh-115103: Update gc.collect to process delayed objects (gh-116251)
* Revert "gh-115103: Update refleak checker to trigger _PyMem_ProcessDelayed (gh-116238)"

This reverts commit 2e91578a76.

* gh-115103: Update gc.collect to process delayed objects
2024-03-03 07:04:29 +09:00
Donghee Na
2e91578a76
gh-115103: Update refleak checker to trigger _PyMem_ProcessDelayed (gh-116238) 2024-03-03 06:44:16 +09:00
Marco Trevisan
140d9ec4bc
gh-85644: webbrowser: Use $XDG_CURRENT_DESKTOP to check desktop (GH-21731)
Usage of $GNOME_DESKTOP_SESSION_ID env variable is deprecated since
GNOME 3.30.0 [1], so should not be used, while the standard
XDG_CURRENT_DESKTOP should be instead preferred.

[1] https://gitlab.gnome.org/GNOME/gnome-session/-/commit/00e0e6226371d53f65
2024-03-02 12:48:24 +00:00
Brett Cannon
5dc8c84d39
GH-115978: Disable *readv() and *writev() on WASI (GH-116228)
Wasmtime doesn't implement these functions in a way to pass test_posix (https://github.com/bytecodealliance/wasmtime/issues/7830).
2024-03-01 16:52:12 -08:00
Eric Snow
cad3745b87
gh-116102: Silence a Compiler Warning in _xxinterpqueues (gh-116230) 2024-03-02 00:28:05 +00:00
Donghee Na
fb5e0344e4
gh-112087: Use QSBR technique for list_new/clear for free-thread build (gh-115875) 2024-03-02 08:30:35 +09:00
Brett Cannon
90a1e9880f
GH-116226: include pthread_stubs.h in pycore_pythreads.h (#116227) 2024-03-01 15:22:31 -08:00
mpage
9e88173d36
gh-114271: Make _thread.ThreadHandle thread-safe in free-threaded builds (GH-115190)
Make `_thread.ThreadHandle` thread-safe in free-threaded builds

We protect the mutable state of `ThreadHandle` using a `_PyOnceFlag`.
Concurrent operations (i.e. `join` or `detach`) on `ThreadHandle` block
until it is their turn to execute or an earlier operation succeeds.
Once an operation has been applied successfully all future operations
complete immediately.

The `join()` method is now idempotent. It may be called multiple times
but the underlying OS thread will only be joined once. After `join()`
succeeds, any future calls to `join()` will succeed immediately.

The internal thread handle `detach()` method has been removed.
2024-03-01 13:43:12 -08:00
Humbulani
5e0c7bc1d3
gh-115941: fixes in dictobject.c doc block(#116196) 2024-03-01 12:48:26 -07:00
Ken Jin
ff96b81d78
gh-115480: Type propagate _BINARY_OP_ADD_UNICODE (GH-115710) 2024-03-02 03:40:04 +08:00
Rémi Lapeyre
b5949eac62
gh-84995: Run sys.__interactivehook__() on asyncio REPL startup (#20517)
This makes the asyncio REPL (`python -m asyncio`) more usable
and similar to the regular REPL.

This exposes register_readline() as a top-level function in site.py,
but it's intentionally undocumented. 

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Itamar Oren <itamarost@gmail.com>
2024-03-01 11:39:16 -08:00
Malcolm Smith
e6e35327d8
gh-115773: Add missing preprocessor guard in _testexternalinspection (#116212)
Add missing preprocessor guard in _testexternalinspection
2024-03-01 17:50:48 +00:00
Erlend E. Aasland
cc6f807760
gh-116171: Argument Clinic: disallow overriding return converter for __init__ methods (#116172) 2024-03-01 18:41:20 +01:00
Erlend E. Aasland
41baa03d30
gh-115806: Don't mangle output of configure 'ipv6 stack type' check (#116165) 2024-03-01 18:38:32 +01:00