Commit graph

30541 commits

Author SHA1 Message Date
kovan
16efaa225c
gh-140490: Document changes for PurePath.stem in Python 3.14 (#144450) 2026-02-07 13:19:20 +01:00
Krishna-web-hub
74db4404ea
gh-84116: Docs: Document help and aliases for argparse.add_parser() (#140574)
* gh-140281: Doc: Update free-threading how-to

* gh-140281: Doc: Update free-threading how-to

* Fix trailing whitespace

* doc fixing of the cpython fixes#84116

* Docs: Document help and aliases for argparse.add_parser() (gh-84116)

* Docs: Document help and aliases for argparse.add_parser() (gh-84116)

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing errors

* Fix trailing errors and spaces

* Fix docutils formatting, NEWS ref, and trailing whitespace

* Docs: Update argparse.rst and add NEWS entry

* Delete Doc/howto/free-threading-python.rst

* Delete Misc/NEWS.d/next/Documentation/2025-10-25-00-49-43.gh-issue-140281.tuMQUe.rst

* adding the depreceated tag

* The error indexing was fixed

* Fix trailing whitespace

* Restore missing free-threading documentation

* fixing some minor error

* fixing some minor error part 2

* fixing some minor error part 3

* Fix NEWS entry format

* Final cleanup of NEWS entry format 2

* changes in the argparse.rst

* Remove unnecessary NEWS entry

* Fixing the issue as requested

* Added the Changes done before.

* done the changes

* done the changes#1

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Done the changes

* Done the new changes

* The versionadded is rectified

* Update Doc/library/argparse.rst

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>

* Docs editing

* Docs fixing whitespace

* Docs rectifiying

* little bit rectification

* Indentation rectification

* Indentation rectification 1

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* deprecated rectification

* Remove mistakenly added NEWS entry

* Update Doc/library/argparse.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* changes #1

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Update Doc/library/argparse.rst 2

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* removed useless thing

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* changed according to the request

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Updated the test part

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-06 13:26:44 -08:00
Stan Ulbrych
fb196c6f32
gh-140715: Update datetime.*.str*time format code tables (GH-140716) 2026-02-06 17:08:26 +01:00
kangtastic
45d4a34720
gh-101178: Add Ascii85, Base85, and Z85 support to binascii (GH-102753)
Add Ascii85, Base85, and Z85 encoders and decoders to binascii,
replacing the existing pure Python implementations in base64.

This makes the codecs two orders of magnitude faster and consume
two orders of magnitude less memory.

Note that attempting to decode Ascii85 or Base85 data of length 1 mod 5
(after accounting for Ascii85 quirks) now produces an error, as no
encoder would emit such data. This should be the only significant
externally visible difference compared to the old implementation.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-06 16:43:16 +02:00
Ned Batchelder
638d22c6e7
Docs: module pages should not link to themselves (#144505)
* Docs: module pages should not link to themselves

* fix header punctuation
2026-02-06 06:48:27 -05:00
Petr Viktorin
f85e1170d2
gh-141004: Reorganize and reword the 'Useful macros' section (GH-144471)
- Group the macros
- Roughly order them to put the most important ones first
- Add expansions where it makes sense; especially if there's
  an equivalent in modern C or a common compiler

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-02-06 11:55:11 +01:00
Stan Ulbrych
cf60e0c452
Docs: Pull expat license from Modules/expat/ in license.rst (#144488)
Use license directly from Modules/expat/COPYING.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-06 09:54:34 +01:00
Seth Michael Larson
957f9fe162
gh-74453: Deprecate os.path.commonprefix (#144436)
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>
2026-02-05 22:37:05 +02:00
Zackery Spytz
01a1dd283b
gh-77188: Add support for pickling private methods and nested classes (GH-21480)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-05 19:50:51 +00:00
Serhiy Storchaka
4644fed819
gh-144001: Support ignoring the invalid pad character in Base64 decoding (GH-144306) 2026-02-05 21:14:49 +02:00
Serhiy Storchaka
c81e1843d4
gh-74955: Document that __all__ must contain strings in normalization form NFKC (GH-144504) 2026-02-05 20:06:33 +02:00
Raymond Hettinger
50e107f149
More realistic lru_cache example (gh-144517) 2026-02-05 12:04:12 -06:00
NewUserHa
d9a2e587fc
gh-142407: Clarify copy performance on Windows in shutil docs (GH-142408) 2026-02-05 17:45:14 +00:00
Seth Michael Larson
7e777c587f
gh-144484: Warn users not to use wsgiref in production 2026-02-05 15:43:39 +00:00
Serhiy Storchaka
67ddba9aa9
gh-144148: Update the urllib.parse documentation (GH-144497)
Document urlsplit() as the main parsing function and urlparse() as
an obsolete variant.
2026-02-05 16:32:17 +02:00
Raymond Hettinger
b6d8aa436b
Itertools recipes: Replace the tabulate() example with running_mean() (gh-144483) 2026-02-04 14:21:20 -06:00
Adorilson Bezerra
1b6d737ee0
gh-106318: Add examples for str.startswith() method (#144369)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-04 18:17:42 +01:00
Peter Bierma
914fbec214
gh-141004: Document remaining pyport.h utility macros (GH-144279)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-04 11:43:47 -05:00
Petr Viktorin
e423e0c2cc
gh-141984: Reword and reorganize Subscription (and Slicing) docs (GH-141985)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-04 16:08:23 +00:00
Lucas Colley
0bb4ecafcb
gh-142903: add conda-forge license for pixi-packages (#143468)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: h-vetinari <h.vetinari@gmx.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-04 12:36:14 +00:00
Serhiy Storchaka
f73d2e7003
gh-144386: Add support for descriptors in ExitStack and AsyncExitStack (#144420)
__enter__(), __exit__(), __aenter__(), and __aexit__() can now be
arbitrary descriptors, not only normal methods, for consistency with the
"with" and "async with" statements.
2026-02-04 13:20:18 +02:00
kovan
34e5a63f14
gh-141444: Replace dead URL in urllib.robotparser example (GH-144443)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:45:15 +02:00
Sam Gross
7e2c9bdc98
gh-120321: Add gi_state, cr_state, and ag_state attributes (gh-144409)
Add `gi_state`, `cr_state`, and `ag_state` attributes to generators,
coroutines, and async generators respectively. These attributes return the
current state as a string (e.g., `GEN_RUNNING`, `CORO_SUSPENDED`).

The `inspect.getgeneratorstate()`, `inspect.getcoroutinestate()`, and
`inspect.getasyncgenstate()` functions now return these attributes directly.

This is in preparation for making `gi_frame` thread-safe, which may involve
stop-the-world synchronization. The new state attributes avoid potential
performance cliffs in `inspect.getgeneratorstate()` and similar functions by
not requiring frame access.

Also removes unused `FRAME_COMPLETED` state and renumbers the frame state enum
to start at 0 instead of -1.
2026-02-03 13:06:32 -05:00
AN Long
53fecbe6e1
gh-127313: Use getLogger() without argument to get root logger in logging cookbook (GH-143683)
Use getLogger() to get root logger in logging cookbook
2026-02-03 15:49:12 +01:00
Seth Michael Larson
4e15b8d95d
gh-74453: Add stronger security warning to os.path.commonprefix (GH-144401) 2026-02-03 15:07:59 +01:00
Adorilson Bezerra
45d00a0791
gh-106318: Add examples for str.rindex() method (#143887)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-03 13:29:05 +00:00
Taneli Hukkinen
bb917d83b1
gh-142956: Update tomllib to parse TOML 1.1.0 (#144243)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-03 13:41:57 +01:00
Petr Viktorin
afc2aeb850
gh-134160: "First extension module" tutorial improvements (GH-144183)
- Pass -v to pip, so compiler output is visible
- Move the call ``spam.system(3)`` up so that error handling is tested
  right after it's added
- Use `PyUnicode_AsUTF8AndSize` as `PyUnicode_AsUTF8` is not in the
  Limited API.
- Add a footnote about embedded NULs.
2026-02-02 15:32:25 +01:00
Serhiy Storchaka
c3b61ef73d
gh-144001: Simplify Base64 decoding with altchars and ignorechars specified (GH-144324)
Treat "+" and "/" like other characters not in the alternative Base64
alphabet when both altchars and ignorechars are specified.
E.g. discard them if they are not in altchars but are in ignorechars,
and set error if they are not in altchars and not in ignorechars.
Only emit warnings if ignorechars is not specified.
2026-02-02 13:38:32 +02:00
Guilherme Leobas
092ef634f5
docs: update dangling reference to LOAD_METHOD in dis.rst (#144358) 2026-02-02 16:00:17 +05:30
Peter Bierma
3a0e183556
gh-144277: Fix usage of free-threaded terminology in the documentation (GH-144333) 2026-02-01 20:39:26 -05:00
adam j hartz
ccbe41e27c
gh-143055: Implementation of PEP 798 (#143056)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-01-30 20:37:52 -08:00
Pablo Galindo Salgado
96e4cd698a
gh-144319: Fix huge page safety in pymalloc arenas (#144331)
The pymalloc huge page support had two problems. First, on
architectures where the default huge page size exceeds the arena
size (e.g. 32 MiB on PPC, 512 MiB on ARM64 with 64 KB base
pages), mmap with MAP_HUGETLB silently allocates a full huge page
even when the requested size is smaller. The subsequent munmap
with the original arena size then fails with EINVAL, permanently
leaking the entire huge page. Second, huge pages were always
attempted when compiled in, with no way to disable them at
runtime. On Linux, if the huge page pool is exhausted, page
faults including copy-on-write faults after fork deliver SIGBUS
and kill the process.

The arena allocator now queries the system huge page size from
/proc/meminfo and skips MAP_HUGETLB when the arena size is not a
multiple of it. Huge pages also now require explicit opt-in at
runtime via the PYTHON_PYMALLOC_HUGEPAGES environment variable,
which is read through PyConfig and respects -E and -I flags.
The config field pymalloc_hugepages is propagated to the runtime
allocators struct so the low-level arena allocator can check it
without calling getenv directly.
2026-01-30 18:18:56 +00:00
Pablo Galindo Salgado
b1bc868fba
gh-144319: Add huge pages support for pymalloc (#144320) 2026-01-29 12:26:11 +00:00
Giampaolo Rodola
9b154aba7d
gh-83069: Use efficient event-driven subprocess.Popen.wait() on Linux / macOS / BSD (#144047) 2026-01-28 15:04:40 +01:00
Nathan Goldbaum
f2b5c206c7
gh-143883: Use named parameters in PyModExport-related declarations & docs (GH-143884) 2026-01-27 10:28:28 +00:00
Bartosz Sławecki
487bd2dea5
gh-142119: Clarify that one contextvars.Token can only reset once in a lifetime (GH-143693) 2026-01-27 10:49:05 +01:00
Nathan Goldbaum
3e9a5b022f
gh-144257: document return values of PyModule_SetDocString (GH-144258)
Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-27 02:15:16 -05:00
Serhiy Storchaka
7febbe6b60
gh-144001: Support ignorechars in binascii.a2b_base64() and base64.b64decode() (GH-144024) 2026-01-26 20:11:40 +02:00
Victor Stinner
933540e332
gh-101888: Add function.__builtins__ to ref documentation (#144174) 2026-01-26 17:15:47 +01:00
Bartosz Sławecki
04d497c284
gh-142119: Clarify context manager protocol documentation on ContextVar.set and Token (GH-143694) 2026-01-26 16:50:27 +01:00
FooIbar
1f55caf97e
gh-144212: Add image/jxl to mimetypes (GH-144213) 2026-01-26 15:26:55 +01:00
Yashraj
923d9d2ac2
gh-143928: Remove outdated comparison between pickle and marshal regarding recursion (#144025) 2026-01-26 14:38:23 +01:00
Solomon Ritzow
9982147433
gh-144233: Fix typo in os.eventfd documentation (#144234) 2026-01-26 10:07:56 +02:00
benediktjohannes
76d3ae71ba
gh-144217: Add dicom support (medical imaging) to mimetypes (GH-144218)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-01-25 22:22:43 +00:00
Yashraj
a51bf70f95
gh-143504: Expose CELL status of a symbol in symtable (#143549) 2026-01-25 15:21:27 +00:00
Serhiy Storchaka
25a10b60b0
gh-144027: Fix documentation for ignorechars in base64.a85decode() (GH-144028)
It does not support an ASCII string.

Also add more tests.
2026-01-23 20:55:48 +02:00
Bartosz Sławecki
03e651d601
Programming FAQ: fix some punctuaction typos (GH-144058)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-01-23 17:34:21 +01:00
Yongtao Huang
f3dd0cae6c
Doc: fix incorrect reference in isasyncgenfunction docs (GH-144099)
Fix incorrect reference in isasyncgenfunction docs
2026-01-23 09:06:47 +01:00
Alex Willmer
f8262b84f5
gh-143513: Remove importlib.abc documentation for removed ABCs (#143605)
In 3.11 ResourceReader, Traversable, & TraversableResources moved from importlib.abc to importlib.resources.abc (commit e712a5b277).

In 3.12 old import locations were deprecated (commit 71848c9609).

In 3.14 backwards-compat support was removed (commit 0751511d24).

Co-authored-by: Brett Cannon <brett@python.org>
2026-01-22 14:00:37 -08:00