Commit graph

13933 commits

Author SHA1 Message Date
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
Raymond Hettinger
741c6386b8
Minor doc edit: Make multinomial() the first math example (gh-132697) 2025-04-18 12:41:13 -05:00
Yuki Kobayashi
7e2672cfcf
gh-132668: Remove outdated description of POP_JUMP_* instructions (#132669) 2025-04-18 14:08:50 +02:00
Tan90909090
f5512a2498
gh-132608: Fix a sample code coloring for ast.While (#132609)
Add missing '>' in prompt.
2025-04-16 19:23:13 +00:00
Jelle Zijlstra
14efcadfd4
typing docs: Clarify Protocol / runtime_checkable docs (#132606)
- Explicitly say that isinstance/issubclass do not work on non-runtime checkable
  protocols.
- Move the sentence "This raises TypeError when applied to a non-protocol class". It
  took me quite some time to decide what "this" was here: it refers to applying the
  decorator, not to an isinstance() call.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-04-16 17:44:17 +00:00
Serhiy Storchaka
8cb177d09b
gh-132099: Accept an integer as the address for BTPROTO_HCI on Linux (GH-132525)
Previously only an integer packed in a tuple was accepted, while
getsockname() could return a raw integer.
Now the result of getsockname() is always acceptable as an address.
2025-04-16 13:02:51 +03:00
Jelle Zijlstra
11f6603845
gh-132491: Rename annotationlib.value_to_string to type_repr (#132492) 2025-04-15 20:10:53 +00:00
Raymond Hettinger
818b6a9ead
Fix argument order in multinomial() example (gh-132557) 2025-04-15 11:50:52 -05:00
Barney Gale
0879ebc953
GH-123599: Match file: URL hostname against machine hostname in urllib (#132523)
In `_is_local_authority()`, return early if the authority matches the
machine hostname from `socket.gethostname()`, rather than resolving the
names and matching IP addresses.
2025-04-15 01:05:06 +01:00
Serhiy Storchaka
61638418a7
gh-70145: Add support for channels in Bluetooth HCI protocol (GH-132481) 2025-04-14 20:09:16 +03:00