124852 Commits

Author SHA1 Message Date
Jelle Zijlstra
3480124321
gh-119180: Set the name of the param to __annotate__ to "format" (#124730) 2024-12-30 08:19:38 -08:00
Erlend E. Aasland
2bd5a7ab0f
Docs: correctly markup sys.monitoring "What's New" entry (#128346)
The sys.monitoring entry was added with commit d2f1d917e.
2024-12-30 14:53:40 +02:00
Zanie Blue
81376fef76
gh-128321: Set LIBS instead of LDFLAGS when checking sqlite3 requirements (#128322)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-12-30 09:55:14 +01:00
Barney Gale
ef63cca494
GH-127381: pathlib ABCs: remove uncommon PurePathBase methods (#127853)
Remove `PurePathBase.relative_to()` and `is_relative_to()` because they
don't account for *other* being an entirely different kind of path, and
they can't use `__eq__()` because it's not on the `PurePathBase` interface.

Remove `PurePathBase.drive`, `root`, `is_absolute()` and `as_posix()`.
These are all too specific to local filesystems.
2024-12-29 22:07:12 +00:00
Barney Gale
c78729f2df
GH-127381: pathlib ABCs: remove PathBase.stat() (#128334)
Remove the `PathBase.stat()` method. Its use of the `os.stat_result` API,
with its 10 mandatory fields and low-level types, makes it an awkward fit
for virtual filesystems.

We'll look to add a `PathBase.info` attribute later - see GH-125413.
2024-12-29 21:42:07 +00:00
Bénédikt Tran
7e819ce0f3
gh-123424: add ZipInfo._for_archive to set suitable default properties (#123429)
---------

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-12-29 18:30:53 +00:00
Gregory P. Smith
ffece5590e
gh-128192: mark new tests with skips based on hashlib algorithm availability (gh-128324)
Puts the _hashlib get_fips_mode logic check into test.support rather than spreading it out among other tests.
2024-12-28 22:32:32 -08:00
Thomas Grainger
c9159b7436
expand the asyncio.run_coroutine_threadsafe recipes (#127576)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-12-29 11:52:29 +05:30
Calvin Bui
f9a5a3a3ef
gh-128192: support HTTP sha-256 digest authentication as per RFC-7617 (GH-128193)
support sha-256 digest authentication

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-12-28 21:05:34 +00:00
Furkan Onder
492b224b99
gh-128279: Enhance the NetBSD compatibility for thread naming (#128280)
Enhance NetBSD compatibility for thread naming in _threadmodule.c.
2024-12-28 19:49:45 +01:00
Yan Yanchii
2cf396c368
gh-119786: Fix typos in InternalDocs/parser.md (#128314) 2024-12-28 17:05:00 +02:00
Thomas Grainger
aab51c3414
gh-128265: Support WASI/Emscripten on PDB tests, by removing asyncio from pdb tests (#128264)
A part of `Lib/test/test_pdb.py` was previously unable to run on WASI/Emscripten
platforms because it lacked support for `asyncio`.
In fact, these tests could be rewritten without the `asyncio` framework because 
`test_pdb` tests the behavior of coroutines, which are not part of `asyncio`.

Now reliance on the availability of `asyncio` has been removed and
part of `test_pdb` that deals with coroutines working on WASI/Emscripten platforms.
2024-12-28 16:59:49 +02:00
Stephen Hansen
aeb9b65aa2
gh-127586: multiprocessing.Pool does not properly restore blocked signals (try 2) (GH-128011)
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.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-12-27 14:09:01 -08:00
Kumar Aditya
64173cd6f2
gh-127949: make deprecation of policy system more prominent (#128290)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-27 15:13:41 +00:00
donBarbos
71de839ec9
gh-127089: Add missing description for codes in http.HTTPStatus (#127100)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2024-12-27 15:12:25 +01:00
Andrew Svetlov
0b5f1fae57
Mention loop_factory argument in docstring for asyncio.run() (#128288) 2024-12-27 14:58:35 +01:00
Damien
08a0728d6c
gh-125887: Update PyObject_HasAttr exception behavior (#125907)
Update PyObject_HasAttr exception behavior

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-12-26 17:57:55 -08:00
CF Bolz-Tereick
401bba6b58
gh-127537: Add __class_getitem__ to the python implementation of functools.partial (#127537) 2024-12-26 17:03:47 -08:00
Moshe Kaplan
ea2b53739f
Remove incorrect imports rationale comment in http.server (#128278)
Remove reference to gethostbyaddr(), because it's not actually used within this code.
2024-12-26 13:53:37 -08:00
Pieter Eendebak
3bd7730bbd
gh-126868: Add freelist for compact ints to _PyLong_New (#128181)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-12-26 15:17:22 +00:00
Bénédikt Tran
fb0b94223d
gh-87138: convert blake2b/2s types to heap types (#127669) 2024-12-26 20:33:57 +05:30
Thomas Grainger
9ddc388527
gh-124761: add socket.SO_REUSEPORT_LB (#124961) 2024-12-26 20:20:20 +05:30
da-woods
42f7a00ae8
Clean up redundant ifdef in list getitem (#128257)
It's already inside a `Py_GIL_DISABLED` block so the `#else` clause is always unused.
2024-12-26 14:40:48 +00:00
Yuki Kobayashi
8a26c7b2af
Docs: Fix comment out in c-api/typeobj.rst (#128266) 2024-12-26 20:09:44 +05:30
Yan Yanchii
c6563f3f22
gh-119786: Fix typos in InternalDocs/frames.md (#128275)
Fix typos in `InternalDocs/frames.md`
2024-12-26 20:09:15 +05:30
Kumar Aditya
3eb746a7b9
gh-127949: add docs for asyncio policy deprecation (#128269) 2024-12-26 20:02:23 +05:30
Yan Yanchii
5c814c83cd
gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199) 2024-12-25 19:42:04 +02:00
Thomas Grainger
81636d3bbd
gh-128234: support emscripten and wasi in async contextlib tests by removing asyncio from contextlib async tests (#95888)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-12-25 13:23:44 +00:00
Kumar Aditya
76f1785657
gh-128002: use internal llist implementation for asyncio tasks (#128256) 2024-12-25 17:51:27 +05:30
Kirill Podoprigora
d9ed42bc00
gh-128201: Fix `DeprecationWarning in test_pdb` (#128202) 2024-12-25 12:56:51 +05:30
Will Childs-Klein
418114c139
gh-128035: Add ssl.HAS_PHA to detect libssl PHA support (GH-128036)
* Add ssl.HAS_PHA to detect libssl Post-Handshake-Auth support

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-24 18:29:27 +00:00
Bogdan Romanyuk
7985d460c7
gh-128227: Regenerate Doc/requirements-oldest-sphinx.txt (#128228) 2024-12-24 20:00:24 +02:00
Dima Ryazanov
7ed6c5c696
gh-127847: Fix position in the special-cased zipfile seek (#127856)
---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-12-24 15:56:42 +00:00
Kumar Aditya
9fce906825
gh-127949: deprecate asyncio.set_event_loop (#128218)
Deprecate `asyncio.set_event_loop` to be removed in Python 3.16.
2024-12-24 19:24:28 +05:30
Sergey Muraviov
3ddd70ceaa
gh-128217: Validate the normalized_environment variable instead of the similarly named function (GH-128220) 2024-12-24 13:06:41 +00:00
AraHaan
bd3e200cce
Add Windows version comments to the python manifest. (GH-127439) 2024-12-24 13:01:21 +00:00
Kumar Aditya
a391d80f4b
gh-127949: deprecate asyncio policy classes (#128216) 2024-12-24 17:30:26 +05:30
Thomas Grainger
3f6a618e49
gh-127949: fix DeprecationWarning in test_inspect.py (#128215) 2024-12-24 15:13:31 +05:30
Yan Yanchii
30efede33c
gh-128195: Add _REPLACE_WITH_TRUE to the tier2 optimizer (GH-128203)
Add `_REPLACE_WITH_TRUE` to the tier2 optimizer
2024-12-24 05:17:47 +08:00
Barney Gale
d61542b5ff
pathlib tests: create test hierarchy without using class under test (#128200)
In the pathlib tests, avoid using the path class under test (`self.cls`) in
test setup. Instead we use `os` functions in `test_pathlib`, and direct
manipulation of `DummyPath` internal data in `test_pathlib_abc`.
2024-12-23 17:22:15 +00:00
Donghee Na
c5b0c90b62
gh-115999: Update test_opcache to test with nested method (gh-128166)
gh-115999: Update test_opcace to test with nested method
2024-12-24 02:08:34 +09:00
T. Wouters
180d417e9f
gh-114203: Optimise simple recursive critical sections (#128126)
Add a fast path to (single-mutex) critical section locking _iff_ the mutex
is already held by the currently active, top-most critical section of this
thread. This can matter a lot for indirectly recursive critical sections
without intervening critical sections.
2024-12-23 13:31:33 +01:00
Alyssa Coghlan
831b6de6d7
gh-126180: Remove getopt and optparse deprecation notices (GH-126227)
* Remove getopt and optparse deprecation notices
* Add new docs sections for command line app helper libraries
* Add guidance on choosing a CLI parsing library to the optparse docs
* Link to the new guidance from the argparse and getopt docs
* Reword intro in docs section for superseded stdlib modules
* Reframe the optparse->argparse guide as a migration guide
  rather than as an upgrade guide

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-12-23 14:17:19 +10:00
Zanie Blue
9d3a8f4949
gh-100384: Error on unguarded-availability in macOS builds (#128155)
Generate a build error on ``unguarded-availability`` in portable macOS builds (i.e. using MACOSX_DEPLOYMENT_TARGET), preventing invalid use of symbols that are not available in older versions of the OS.
2024-12-22 11:01:45 -08:00
Yan Yanchii
f420bdd29f
gh-119786: Fix typos in InternalDocs/interpreter.md (#128174) 2024-12-22 18:34:16 +02:00
Thomas Grainger
b66a4ad9fc
gh-127949: fix resource warnings in test_tasks.py (#128172) 2024-12-22 18:16:02 +05:30
Gregory P. Smith
228f275737
gh-126664: revert: Use else instead of finally in docs explaining "with" (#128169)
Revert "gh-126664: Use `else` instead of `finally` in "The with statement" documentation. (GH-126665)"

This reverts commit 25257d61cfccc3b4189f96390a5c4db73fd5302c.
2024-12-22 09:47:41 +00:00
Barney Gale
8d9f52a7be
GH-127807: pathlib ABCs: move private copying methods to dedicated class (#127810)
Move 9 private `PathBase` attributes and methods into a new `CopyWorker`
class. Change `PathBase.copy` from a method to a `CopyWorker` instance.

The methods remain private in the `CopyWorker` class. In future we might
make some/all of them public so that user subclasses of `PathBase` can
customize the copying process (in particular reading/writing of metadata,)
but we'd need to make `PathBase` public first.
2024-12-22 02:22:08 +00:00
Barney Gale
f5ba74b819
GH-127807: pathlib ABCs: remove a few private attributes (#127851)
From `PurePathBase` delete `_globber`, `_stack` and `_pattern_str`, and
from `PathBase` delete `_glob_selector`. This helps avoid an unpleasant
surprise for a users who try to use these names.
2024-12-22 01:41:38 +00:00
Barney Gale
a959ea1b0a
GH-127807: pathlib ABCs: remove PurePathBase._raw_paths (#127883)
Remove the `PurePathBase` initializer, and make `with_segments()` and
`__str__()` abstract. This allows us to drop the `_raw_paths` attribute,
and also the `Parser.join()` protocol method.
2024-12-22 01:17:59 +00:00