Commit graph

13942 commits

Author SHA1 Message Date
Petr Viktorin
59f78d7b06
gh-131747: ctypes: Deprecate _pack_ implicitly setting _layout_ = 'ms' (GH-133205)
On non-Windows, warn when _pack_ implicitly changes default _layout_
to 'ms'.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-05-05 15:32:06 +02:00
Lysandros Nikolaou
b97328ef5d
gh-107006: Move threading.local docstring to docs (#131840)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-05 15:00:15 +03:00
Tian Gao
ff4959b6b0
gh-113081: Highlight source code in pdb (#133355) 2025-05-05 09:49:52 +02:00
Thomas Grainger
08d7687094
gh-128307: Support eager_start=<bool> in create_eager_task_factory and various create_task functions (#128306)
Some create_task() functions were changed from `name=None, context=None` to `**kwargs`.

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
2025-05-05 04:58:07 +00:00
Nadeshiko Manju
2bbcaedb75
gh-133089: Use original timeout value for TimeoutExpired when the func subprocess.run is called with a timeout (GH-133103)
Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-05 01:15:31 +00:00
Jelle Zijlstra
af5799f305
gh-125618: Make FORWARDREF format succeed more often (#132818)
Fixes #125618.
2025-05-04 15:21:56 -07:00
Jelle Zijlstra
7cb86c5def
gh-132426: Add get_annotate_from_class_namespace replacing get_annotate_function (#132490)
As noted on the issue, making get_annotate_function() support both types and
mappings is problematic because one object may be both. So let's add a new one
that works with any mapping.

This leaves get_annotate_function() not very useful, so remove it.
2025-05-04 07:26:42 -07:00
Serhiy Storchaka
5a57248b22
gh-81793: Always call linkat() from os.link(), if available (GH-132517)
This fixes os.link() on platforms (like Linux and OpenIndiana) where the
system link() function does not follow symlinks.

* On Linux, it now follows symlinks by default and if
  follow_symlinks=True is specified.
* On Windows, it now raises error if follow_symlinks=True is passed.
* On macOS, it now raises error if follow_symlinks=False is passed and
  the system linkat() function is not available at runtime.
* On other platforms, it now raises error if follow_symlinks is passed
  with a value that does not match the system link() function behavior
  if if the behavior is not known.

Co-authored-by: Joachim Henke <37883863+jo-he@users.noreply.github.com>
Co-authored-by: Thomas Kluyver <takowl@gmail.com>
2025-05-04 17:24:10 +03:00
Serhiy Storchaka
7363e8d24d
gh-133139: Add curses.assume_default_colors() (GH-133145)
This is a refinement of the curses.use_default_colors() function which
allows to change the color pair 0.
2025-05-03 23:33:22 +03:00
Serhiy Storchaka
add0ca9ea0
gh-133306: Use \z instead of \Z in fnmatch.translate() and glob.translate() (GH-133338) 2025-05-03 17:58:21 +03:00
Semyon Moroz
1550c30fd5
gh-130160: use .. program:: directive for documenting platform CLI (#133335) 2025-05-03 15:05:04 +03:00
Serhiy Storchaka
ac56f8cc8d
gh-133306: Support \z as a synonym for \Z in regular expressions (GH-133314)
\Z was an error inherited from PCRE 0.95. It was fixed in PCRE 2.0.
In other engines, \Z means not “anchor at string end”, but
“anchor before optional newline at string end”.

\z means “anchor at string end” in most RE engines.
2025-05-03 07:54:33 +00:00
Malcolm Smith
245cd6c532
gh-91156: Document how TextIOWrapper interacts with UTF-8 mode (GH-132885)
Document how TextIOWrapper interacts with UTF-8 mode
2025-05-03 10:20:10 +09:00
Sergey Miryanov
a0bc0c462f
gh-100926: Move ctype's pointers cache from _pointer_type_cache to StgInfo (GH-131282)
Deprecate _pointer_type_cache and calling POINTER on a string.

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-05-02 19:06:37 +02:00
Sergey B Kirpichev
d78768e3d6
gh-121249: fix complex formatting codes in the struct docs (note 10) (GH-133249)
This amends 85f89cb.
2025-05-02 18:27:07 +02:00
Sergey B Kirpichev
f425509349
gh-121249: unconditionally support complex types in struct (GH-132864)
Co-authored-by: Lisandro Dalcin <dalcinl@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-02 18:24:52 +02:00
Hugo van Kemenade
e6c518d2eb
gh-133300: argparse: make suggest_on_error a keyword-only parameter (#133302) 2025-05-02 18:11:44 +03:00
Hugo van Kemenade
4701ff92d7
gh-130645: Add color to argparse help (GH-132323) 2025-05-02 15:06:10 +02:00
Yongzi Li
df8a02b1e1
Docs: delete title links in turtle.rst and typing.rst (#133283)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-05-02 13:15:26 +01:00
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
Tian Gao
caee16f052
gh-121468: Support async breakpoint in pdb (#132576) 2025-04-29 12:28:24 -04: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
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
Alyssa Ross
314f4b9716
gh-132991: Add socket.IP_FREEBIND constant (GH-132998) 2025-04-26 20:54:12 +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
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
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
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
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
Serhiy Storchaka
e84624450d
gh-132734: Add new constants for Bluetooth sockets (GH-132735) 2025-04-22 11:02:13 +00: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
Peter Bierma
8dfa840773
gh-127604: Add C stack dumps to faulthandler (#128159) 2025-04-21 20:48:02 +01:00
Adam Turner
fee808936f
gh-85583: Add an overview of formatted string literals (f-strings) to `str` (#132689) 2025-04-21 07:49:06 +00:00
Stan Ulbrych
a16586c9e7
gh-129327: revise hashlib documentation to account for FIPS removing sha1 (GH-132729)
* gh-129327: revise hashlib documentation to account for FIPS removing sha1

More generally, the current documentation is a bit scattered, talking
about what terms are "equal" despite those terms not being very
interesting and given the term "secure hash", probably wrong (because
md5 and sha1 are not secure anymore).

Let's talk about cryptographically secure instead, and note that two of
them aren't. And then we can also link to the source for NIST going
through the removal process for SHA1.

* Add Gregors Suggestion

* Clean up

---------

Co-authored-by: Eli Schwartz <eschwartz@gentoo.org>
2025-04-20 01:06:24 +00:00
Stan Ulbrych
e154e4db36
Docs: Fix REPL example in Doc/library/shutil.rst (#132700) 2025-04-19 16:15:00 +02:00
Jeroen Bogers
ce31ae5209
gh-129719: Restore missing socket.CAN_RAW_ERR_FILTER on Linux (#129721)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-04-18 22:59:37 +03:00