Commit graph

14434 commits

Author SHA1 Message Date
AN Long
bd1ada6df3
gh-138092: Allow calling mmap.flush with offset only (#138093) 2025-09-30 11:08:50 +02:00
Adam Turner
8bfdda21a3
GH-123299: Copyedit 3.14 What's New: CPython bytecode changes (#139402)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-29 15:11:54 +00:00
Yongzi Li
519bc470fc
gh-135447: Document the `NOT_TAKEN & POP_ITER` bytecode instructions (#135803)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2025-09-28 16:46:01 +00:00
Bénédikt Tran
666112376d
gh-90949: expose Expat API to tune exponential expansion protections (#139368)
Expose the XML Expat 2.7.2 APIs to tune protections against
"billion laughs" [1] attacks.

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and
- `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`.

This completes the work in f04bea44c3,
and improves the existing related documentation.

[1]: https://en.wikipedia.org/wiki/Billion_laughs_attack
2025-09-28 08:27:04 +00:00
Bénédikt Tran
68a1778b77
gh-90949: amend GH-139234 in prevision of future mitigation API (#139366)
Fix some typos left in f04bea44c3,
and simplify some internal functions to ease maintenance of future
mitigation APIs.
2025-09-26 17:59:40 +00:00
Bénédikt Tran
f04bea44c3
gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (#139234)
Expose the XML Expat 2.7.2 mitigation APIs to disallow use of
disproportional amounts of dynamic memory from within an Expat
parser (see CVE-2025-59375 for instance).

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetAllocTrackerActivationThreshold(threshold)`, and
- `parser.SetAllocTrackerMaximumAmplification(max_factor)`.
2025-09-26 14:13:56 +00:00
Sebastian Pipping
6fa1e552e0
gh-127502: Fix typo in XML security notes (#139335) 2025-09-26 11:59:08 +02:00
Raymond Hettinger
7909b30493
gh-138682: Add symmetric difference to Counter (gh-138766) 2025-09-26 00:04:49 -05:00
sobolevn
06703d6637
Remove .. deprecated-removed notes for typing.{NamedTuple, TypedDict} (#139298) 2025-09-24 16:24:58 +03:00
Stan Ulbrych
30f849250b
gh-83336: Add alias for consistency to utf-8-sig (#136530)
Closes #83336
2025-09-24 10:38:57 +02:00
Serhiy Storchaka
1a2e00c97a
gh-67795: Accept any real numbers as timestamp and timeout (GH-139224)
Functions that take timestamp or timeout arguments now accept any
real numbers (such as Decimal and Fraction), not only integers or floats,
although this does not improve precision.
2025-09-23 21:31:42 +03:00
Stan Ulbrych
4fb338d844
Doc/library/zoneinfo.rst: Fix typo (#139190)
Removes duplicated wording.
2025-09-22 07:25:39 -04:00
Stan Ulbrych
9c3d09b984
Doc/library/os.rst: Remove spurious parenthesis (GH-139205) 2025-09-21 14:57:13 -04:00
AN Long
e101f907dc
gh-138092: Correct the documented signature of `mmap.flush` (#138671) 2025-09-21 11:54:30 +01:00
Serhiy Storchaka
20d5494c88
Revert "gh-66234: Add flag to disable the use of mmap in dbm.gnu (GH-135005)" (GH-136989)
This reverts commit 0cec424af5.
2025-09-20 11:01:44 +03:00
Karolina Surma
b36dee855d
Fix the reference to unicode specification (#139138) 2025-09-19 14:28:55 +02:00
Semyon Moroz
495f589363
gh-121237: Add %:z directive to datetime.strptime (#136961) 2025-09-19 10:25:31 +01:00
Alex Waygood
4305cc3ef3
gh-118803: Improve documentation around ByteString deprecation (#139115) 2025-09-18 17:29:59 +00:00
Nicholas Tindle
0f27e10204
gh-137976: Explicitly exclude localtime from available_timezones (#138012)
* fix: available_timezones is reporting an invalid IANA zone name

* 📜🤖 Added by blurb_it.

* correct rst format for backticks

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2025-09-18 17:32:14 +01:00
Benjamin Peterson
e163fbdeda
fixes gh-139090: add os.RWF_DONTCACHE (#139091) 2025-09-18 08:13:23 -07:00
Moshe Kaplan
101fd33065
GH-139067: Add example for argparse's append action (#131389) 2025-09-17 17:24:20 +01:00
chiri
8eb106240f
gh-138736: Fix sqlite3.Connection.blobopen 'row' parameter type and naming (#138738)
The 'row' parameter represents a ROWID. Clarify this in docs and docstrings.
2025-09-17 15:51:14 +00:00
Hans Then
dd0840bf67
gh-132558: Improve argparse docs on combining type and choices (#133827)
Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
2025-09-17 15:25:17 +00:00
PrinceNaroliya
37425fe9fb
gh-137988: Fix const description in argparse.add_argument() docs (#138315)
Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
2025-09-17 15:15:57 +00:00
Aniket
dd15a2e11e
gh-138952: Document platform.machine() output casing inconsistency across platforms (#138962)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-09-17 15:56:21 +01:00
PrinceNaroliya
81c975bcfc
gh-139006: Doc: Clarify html.escape function description (#139016)
Doc: Clarify html.escape function description (GH-139006)
2025-09-17 21:45:34 +08:00
Donghoon Nam
c025576a8f
gh-138966: Add description for gi_suspended attribute (GH-139008) 2025-09-17 04:21:52 -04:00
Serhiy Storchaka
cf9ef73121
gh-134716: Support regular expressions in -W and PYTHONWARNINGS (GH-138149) 2025-09-16 17:06:44 +00:00
Alex Waygood
530ddd3e06
Revert "gh-118803: Remove ByteString from typing and collections.abc (#118804)" (#138990) 2025-09-16 16:48:19 +01:00
Benjamin Johnson
ab6893ab5c
gh-138514: getpass: restrict echo_char to a single ASCII character (#138591)
This amends commit bf8bbe9a81 by
restricting `echo_char` in `getpass.getpass` to single printable
ASCII characters as it would be uncommon to use long strings or
multi-byte characters for keyboard feedback.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-09-16 16:21:55 +02:00
ivan
01cc53295c
Synced docs and docstring for sysconfig.get_platform (#135530)
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
Co-authored-by: Ned Deily <nad@python.org>
2025-09-16 12:16:48 +01:00
Serhiy Storchaka
a003112821
gh-138712: Add os.NODEV (GH-138728) 2025-09-15 14:36:32 +00:00
Benjamin Peterson
5bd4bf04c4
closes gh-138706: update Unicode to 17.0.0 (#138719) 2025-09-11 09:58:39 -07:00
Maurycy Pawłowski-Wieroński
e0f54a608e
gh-138005: Document that CSV skipinitialspace=True and delimiter=' ' require quotation for empty fields (#138006) 2025-09-11 18:11:33 +03:00
Samuel Sloniker
66ef16105a
gh-85076: Document exceptions that can be raised by importlib.import_module (GH-94662) 2025-09-09 12:52:00 -07:00
Serhiy Storchaka
af58a6f883
gh-88886: Remove excessive encoding name normalization (GH-137167)
The codecs lookup function now performs only minimal normalization of
the encoding name before passing it to the search functions:
all ASCII letters are converted to lower case, spaces are replaced
with hyphens.

Excessive normalization broke third-party codecs providers, like
python-iconv.

Revert "bpo-37751: Fix codecs.lookup() normalization (GH-15092)"

This reverts commit 20f59fe1f7.
2025-09-09 21:07:21 +03:00
yagggi
074f3b20b3
gh-138577: Mention Unix-specific limitations of getpass.getpass(echo_char=...) (#138677)
In bf8bbe9a81, `getpass.getpass` gained
the ability to provide keyboard feedback through `echo_char`.

On Unix, line editing shortcuts such as Ctrl+U were previously handled
as the terminal operates in canonical mode (see termios(3)). However,
since keyboard feedback requires to switch to noncanonical mode, this
now results in an inconsistency when `getpass.getpass` uses `echo_char`
as those shortcuts are no more supported. This limitation is specific
to Unix and does not affect Windows users where line editing shortcuts
were never supported.
2025-09-09 11:41:13 +02:00
Adam Turner
22cb9ba8f9
GH-101100: Remove some entries from `nitpick_ignore` (#138464) 2025-09-08 22:10:26 +00:00
Shamil
c6f8b2fdb1
gh-138665: Move platform.invalidate_caches docs (#138667) 2025-09-08 17:20:46 +02:00
Klaus Zimmermann
1acb718ea2
gh-133143: Add sys.abi_info (GH-137476)
This makes information about the interpreter ABI more accessible.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-08 14:35:44 +00:00
Adorilson Bezerra
921f61bd82
Doc: Apply keyword role around finally (in sys module doc) (GH-138544) 2025-09-08 14:02:36 +02:00
Bénédikt Tran
4ef51fa75c
gh-138633: fix Sphinx references in ssl documentation (#138648) 2025-09-08 11:31:40 +00:00
Bénédikt Tran
3255c0c870
gh-138633: synchronize documented signatures of SSL objects with runtime ones (#138639) 2025-09-08 09:28:10 +00:00
Ron Frederick
6401823db3
gh-138252: Add support in SSL module for getting and setting TLS signature algorithms (#138269)
The signature algorithms allowed for certificate-based client authentication or
for the server to complete the TLS handshake can be defined on a SSL context via
`ctx.set_client_sigalgs()` and `ctx.set_server_sigalgs()`.

With OpenSSL 3.4 or later, the list of available TLS algorithms can be retrieved
by `ssl.get_sigalgs()`.

With OpenSSL 3.5 or later, the selected signature algorithms can be retrieved from
SSL sockets via `socket.client_sigalg()` and `socket.server_sigalg()`.

This commit also partially amends 377b787618
by using `PyUnicode_DecodeFSDefault` instead of `PyUnicode_DecodeASCII` in
`_ssl._SSLContext.get_groups`, so that functions consistently decode strings
obtained from OpenSSL.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-09-08 08:36:12 +00:00
Gilles Peiffer
c117b03385
Docs: Fix typo in random_derangement recipe (GH-138599) 2025-09-06 16:53:49 -04:00
AN Long
c919d02ede
gh-138205: Remove the resize method on mmap object on platforms don't support it (#138276)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-09-06 14:10:04 +05:30
W. H. Wang
8368895049
gh-137985: Correct description of Formatter's datefmt param in logging documentation (GH-138530) 2025-09-05 22:07:04 +01:00
Adam Turner
8ed1d53e62
GH-138465: Improve documentation for common sequence methods (#138474)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-05 20:55:02 +01:00
Jelle Zijlstra
9158bcf86b
annotationlib: add note on security to docs (#138508) 2025-09-05 08:26:58 -07:00
Brian Schubert
fc0305a2d8
docs: add module-level versionadded for annotationlib (#138511) 2025-09-04 13:45:21 -07:00