Commit Graph

29405 Commits

Author SHA1 Message Date
Rafael Fontenelle 2b67db7ce3
Apply 'mod' role to typing module (#133201)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-30 16:52:03 +00:00
dgpb a4b7128301
gh-89867: string.Formatter auto numbering doc updates (GH-129617) 2025-04-30 14:24:40 +02:00
Lysandros Nikolaou 60202609a2
gh-132661: Implement PEP 750 (#132662)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wingy <git@wingysam.xyz>
Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Paul Everitt <pauleveritt@me.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-04-30 11:46:41 +02:00
Inada Naoki 4e294f6feb
gh-133036: Deprecate codecs.open (#133038)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-30 10:11:09 +09:00
Serhiy Storchaka c46635aa5a
gh-120220: Deprecate legacy methods for tracing variables in Tkinter (GH-120223)
They do not work with Tcl 9.0.
Use new methods added in Python 3.6.
2025-04-29 20:26:51 +03:00
Tian Gao caee16f052
gh-121468: Support async breakpoint in pdb (#132576) 2025-04-29 12:28:24 -04:00
Stan Ulbrych bba14c3e01
gh-46236: Document `PyUnicodeIter_Type` (GH-132925) 2025-04-29 14:23:06 +02:00
Stan Ulbrych 59ff42155a
gh-57281: Fix duplicate deprecation note: array 'u' format (#133113) 2025-04-29 13:22:15 +02:00
Petr Viktorin 0c26dbd16e
gh-133079: Remove Py_C_RECURSION_LIMIT & PyThreadState.c_recursion_remaining (GH-133080)
Both were added in 3.13, are undocumented, and don't make sense in 3.14 due to
changes in the stack overflow detection machinery (gh-112282).

PEP 387 exception for skipping a deprecation period: https://github.com/python/steering-council/issues/288
2025-04-29 12:56:20 +02:00
Eric Snow fe462f5a91
gh-132775: Drop PyUnstable_InterpreterState_GetMainModule() (gh-132978)
We replace it with _Py_GetMainModule(), and add _Py_CheckMainModule(), but both in the internal-only C-API.  We also add _PyImport_GetModulesRef(), which is the equivalent of _PyImport_GetModules(), but which increfs before the lock is released.

This is used by a later change related to pickle and handling __main__.
2025-04-28 12:46:22 -06:00
Hugo van Kemenade 4cec0b510b
gh-129965: Add more missing MIME types (#132845) 2025-04-28 15:30:35 +00:00
Semyon Moroz 0f84f6b334
gh-132726: Change the heading of `sysconfig` CLI section (#133035) 2025-04-28 17:44:49 +03:00
Hugo van Kemenade ee9102a535
gh-75223: Deprecate undotted extensions in `mimetypes.MimeTypes.add_type` (#128638)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Daniel Watkins <daniel@daniel-watkins.co.uk>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2025-04-28 14:23:57 +00:00
Petr Viktorin 4ebbfcf30e
gh-87135: Raise PythonFinalizationError when joining a blocked daemon thread (gh-130402)
If `Py_IsFinalizing()` is true, non-daemon threads (other than the current one)
are done, and daemon threads are prevented from running, so they
cannot finalize themselves and become done. Joining them (without timeout)
would block forever.

Raise PythonFinalizationError instead of hanging.

Raise even when a timeout is given, for consistency with trying to join your own thread.

See gh-123940 for a use case: calling `join()` from `__del__`. This is
ill-advised, but an exception should at least make it easier to diagnose.
2025-04-28 15:48:48 +02:00
Sergey B Kirpichev 5bf0f3666e
gh-53032: support IEEE 754 contexts in the decimal module (#122003)
This was in C version from beginning, but available only
on conditional compilation (EXTRA_FUNCTIONALITY).  Current
patch adds function to create IEEE contexts to the
pure-python module as well.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-28 15:05:56 +02:00
Steve Dower e20ca6d1b0
gh-132930: Implement PEP 773 (GH-132931)
This change to the core CPython repo:
* Adds PyManager support to PC/layout
* Adds a warning message to the legacy py.exe if subcommands are invoked
* Add deprecation message to traditional installer
* Updates using/windows docs
2025-04-28 13:57:47 +01:00
Yuki Kobayashi 4e04511cb9
gh-133033: Add docs for `TypeIgnore` (#133034)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-04-28 13:49:07 +03:00
Yongzi Li cd76eff26e
Docs: fix a couple typos in `Doc/` (GH-132927)
fix minor typos
2025-04-27 15:56:58 -07:00
Bénédikt Tran 24436629ef
gh-127604: ensure `-ldl` is passed to the linker when `dladdr1` is found (#133040) 2025-04-28 00:28:42 +02:00
Michał Górny 019ee49d50
gh-133005: Support `tarfile.open(mode="w|xz", preset=...)` (GH-133007)
* gh-133005: Support `tarfile.open(mode="w|xz", preset=...)`

Support passing the `preset` option to `tarfile.open` when the file
is open with `mode="w|xz"`.  This aligns the behavior with `"w:xz"`
mode.

* Also raise an error for `compresslevel` or `preset` with wrong mode

Raise an error if `compresslevel` or `preset` argument is specified
for stream mode with incorrect compression. This should reduce the risk
of mistakes and align the stream modes with regular modes, that raise
an implicit TypeError on unsupported arguments.

* Apply suggestions from code review

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-04-27 22:19:59 +00:00
Mariusz Felisiak 28a2fd031e
gh-115032: Deprecate support for custom logging handlers with 'strm' argument. (GH-115314) 2025-04-27 22:18:14 +01:00
Alyssa Ross 314f4b9716
gh-132991: Add socket.IP_FREEBIND constant (GH-132998) 2025-04-26 20:54:12 +03:00
Serhiy Storchaka 632524a5cb
gh-132987: Support __index__() for "k" and "K" formats in PyArg_Parse (GH-132988) 2025-04-26 17:14:18 +03:00
Victor Stinner ac5424d6a9
gh-107954: Add audit event to PyConfig_Set() (#132958) 2025-04-25 18:30:39 +02:00
Victor Stinner 070d866567
gh-107954: Allow setting cpu_count in PyConfig_Set() (#132954)
* gh-107954: Allow setting cpu_count in PyConfig_Set()

* Update the doc
2025-04-25 18:29:55 +02:00
Stan Ulbrych f6fb498c97
gh-132798: Schedule removal of `PyUnicode_AsDecoded/Encoded` functions for 3.15 (#132799)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-25 15:07:41 +02:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) 8783cec9b6
gh-129027: Raise DeprecationWarning for sys._clear_type_cache (#129043)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-25 15:01:48 +03:00
Ronald Oussoren 25e49841e3
gh-113539: Enable using ``$BROWSER`` to reorder default seach order in webbrowser.py (#113561)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-25 14:36:18 +03:00
Bénédikt Tran 3fa024dec3
gh-132909: handle overflow for `'K'` format in `do_mkvalue` (#132911) 2025-04-25 11:02:57 +00:00
Bénédikt Tran 6a9bfee4fa
gh-131423: Update OpenSSL data to 3.4.1 on Linux (#131618)
OpenSSL 3.4.1 mnemonics are not compatible with OpenSSL 3.4.0 ones since
they were renumbered [1, 2]. Consequently, `_ssl_data_34.h` is renamed to
`_ssl_data_340.h` and `_ssl_data_34.h` now contains OpenSSL 3.4.1 mnemonics.

We also refine the mnemonics that are selected, discarding those that are
mnemonic-like but should not be used as such. More precisely, we remove
the ERR_LIB_MASK and ERR_LIB_OFFSET entries from OpenSSL 1.1.1 data.

[1]: https://github.com/openssl/openssl/issues/26316
[2]: https://github.com/openssl/openssl/issues/26388
2025-04-25 10:26:58 +02:00
Ruben Vorderman b1fc8b69ec
gh-98347: Add links to python-isal in the documentation (#98637)
Clearly note that this is primarily intended for users for who zlib/gzip is a bottleneck.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-25 01:53:23 +00:00
Steele Farnsworth 99b71efe8e
gh-129858: Special syntax error for `elif` block after `else` (#129902) 2025-04-25 01:25:48 +00:00
Matt Wozniski 797b29b1b5
gh-131591: Allow pdb to attach to a running process (#132451)
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2025-04-25 01:43:23 +01:00
Brett Cannon 15ff60aff0
Differentiate bitwise OR from the word "or" (#132890) 2025-04-24 23:05:02 +01:00
RUANG (James Roy) 8e18a9dce2
gh-127385: Add F_DUPFD_QUERY to fcntl (GH-127386) 2025-04-25 00:06:42 +03:00
Serhiy Storchaka 9f5994b94c
gh-132742: Refactor fcntl.fcntl() and fcntl.ioctl() (GH-132768)
* Support arbitrary bytes-like objects, not only bytes, in fcntl().
* The fcntl() buffer argument is now null-terminated.
* Automatically retry an ioctl() system calls failing with EINTR.
* Release the GIL for an ioctl() system call even for large bytes-like object.
* Do not silence arbitrary errors whet try to get a buffer.
* Optimize argument parsing, check the argument type before trying to get
  a buffer or convert it to integer.
* Fix some error messages.
2025-04-24 19:17:11 +03:00
Kuba_Z2 984a314b9f
Fix a grammar error in the `Py_ALWAYS_INLINE` doc (#129304) 2025-04-24 17:20:48 +03:00
Inada Naoki b1f2304b20
doc: update co_flags reference (#132300)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-24 14:05:56 +00:00
Sergey B Kirpichev 8047e50cb7
gh-128185: Align Decimal docs with spec (case irrelevant for nan/inf) (#128323) 2025-04-24 17:02:49 +03:00
Jordi Burguet-Castell 1583f9cdd4
gh-122399: change webbrowser.rst to better describe the contents of controller object (#122407)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-24 16:56:52 +03:00
Sergey B Kirpichev 85f89cb3e6
gh-121249: adjust formatting codes for complex types in struct/ctypes (#132827)
* F - for float _Complex
* D - for double _Complex
* G - for long double _Complex (not supported by the struct module)
2025-04-23 15:38:24 +02:00
Pablo Galindo Salgado 41dec4158d
gh-132449: Add whatsnew entry for typos in keywords (#132838) 2025-04-23 14:27:53 +01:00
Serhiy Storchaka 5f50541ebd
gh-132742: Update documentation for the fcntl module (GH-132765) 2025-04-23 14:27:21 +03:00
pulkin 77605fa3bb
gh-131913: multiprocessing: add interrupt for POSIX (GH-132453)
* multiprocessing: interrupt

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-22 23:55:24 -07:00
Sergey B Kirpichev 79f7c67bf6
gh-128813: hide mixed-mode functions for complex arithmetic from C-API (#131703) 2025-04-22 14:18:18 +02:00
Stan Ulbrych 5ffb89420c
gh-46236: Add Py_UNICODE_REPLACEMENT_CHARACTER doc (#132706)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-22 14:16:51 +02:00
Serhiy Storchaka e84624450d
gh-132734: Add new constants for Bluetooth sockets (GH-132735) 2025-04-22 11:02:13 +00:00
RUANG (James Roy) 05d0559db0
gh-46236: Add PyUnicode_Resize() doc (#132628)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-04-22 11:39:04 +02:00
Sergey B Kirpichev d0660a9a40
gh-101410: Customize error messages for 1-arg math functions (#129497)
This also reverts loghelper() change in 75f59bb629 for integer
input.  The error message shouldn't include argument value here.

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-22 11:29:20 +02:00
Sebastian Rittau 2b47f46d7d
gh-122179: Fix hashlib.file_digest and non-blocking I/O (GH-122183)
* Fix hashlib.file_digest and non-blocking I/O
* Add documentation around this behavior
* Add versionchanged
2025-04-21 14:15:05 -07:00