]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
21 months agogh-111964: Implement stop-the-world pauses (gh-112471)
Sam Gross [Tue, 23 Jan 2024 18:08:23 +0000 (13:08 -0500)] 
gh-111964: Implement stop-the-world pauses (gh-112471)

The `--disable-gil` builds occasionally need to pause all but one thread.  Some
examples include:

* Cyclic garbage collection, where this is often called a "stop the world event"
* Before calling `fork()`, to ensure a consistent state for internal data structures
* During interpreter shutdown, to ensure that daemon threads aren't accessing Python objects

This adds the following functions to implement global and per-interpreter pauses:

* `_PyEval_StopTheWorldAll()` and `_PyEval_StartTheWorldAll()` (for the global runtime)
* `_PyEval_StopTheWorld()` and `_PyEval_StartTheWorld()` (per-interpreter)

(The function names may change.)

These functions are no-ops outside of the `--disable-gil` build.

21 months agogh-112984: Fix link error on free-threaded Windows build (GH-114455)
Sam Gross [Tue, 23 Jan 2024 18:05:15 +0000 (13:05 -0500)] 
gh-112984: Fix link error on free-threaded Windows build (GH-114455)

The test_peg_generator test tried to link the python313_d.lib library,
which failed because the library is now named python313t_d.lib. The
underlying problem is that the "compiler" attribute was not set when
we call get_libraries() from distutils.

21 months agogh-108303: Move `.whl` test files to `Lib/test/wheeldata/` (#114343)
Nikita Sobolev [Tue, 23 Jan 2024 15:33:12 +0000 (18:33 +0300)] 
gh-108303: Move `.whl` test files to `Lib/test/wheeldata/` (#114343)

21 months agoDocs: mark up FTP.connect() and FTP.login() with param lists (#114395)
Erlend E. Aasland [Tue, 23 Jan 2024 13:57:23 +0000 (14:57 +0100)] 
Docs: mark up FTP.connect() and FTP.login() with param lists (#114395)

Use rst substitutions to reduce raw text duplication.

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
21 months agoDocs: mark up FTP.retrbinary and FTP.storbinary with param lists (#114399)
Erlend E. Aasland [Tue, 23 Jan 2024 13:53:35 +0000 (14:53 +0100)] 
Docs: mark up FTP.retrbinary and FTP.storbinary with param lists (#114399)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
21 months agogh-114423: Remove DummyThread from threading._active when thread dies (GH-114424)
Fabio Zadrozny [Tue, 23 Jan 2024 12:12:50 +0000 (09:12 -0300)] 
gh-114423: Remove DummyThread from threading._active when thread dies (GH-114424)

21 months agogh-101100: Fix sphinx warnings in `Doc/library/locale.rst` (#114425)
Nikita Sobolev [Tue, 23 Jan 2024 11:05:27 +0000 (14:05 +0300)] 
gh-101100: Fix sphinx warnings in `Doc/library/locale.rst` (#114425)

* gh-101100: Fix sphinx warnings in `Doc/library/locale.rst`

* Remove `/` from signatures

21 months agogh-113317: Don't use global clinic instance in bad_argument() (#114330)
Erlend E. Aasland [Tue, 23 Jan 2024 10:07:56 +0000 (11:07 +0100)] 
gh-113317: Don't use global clinic instance in bad_argument() (#114330)

Make it possible for a converter to have multiple includes, by collecting
them in a list on the converter instance. This implies converter includes
are added during template generation, so we have to add them to the
clinic instance at the end of the template generation instead of in the
beginning.

21 months agogh-89427: Provide the original prompt value for VIRTUAL_ENV_PROMPT (GH-106726)
Jim Porter [Tue, 23 Jan 2024 08:53:04 +0000 (00:53 -0800)] 
gh-89427: Provide the original prompt value for VIRTUAL_ENV_PROMPT (GH-106726)

This improves the implementation in gh-106643.

Previously, venv passed "(<prompt>) " to the activation scripts, but we want
to provide the original value so that users can inspect it in the
$VIRTUAL_ENV_PROMPT env var.

Note: Lib/venv/scripts/common/Activate.ps1 surrounded the prompt value with
parens a second time, so no change was necessary in that file.

21 months agoGH-105900: Fix `pathlib.Path.symlink_to(target_is_directory=...)` docs (#114035)
Barney Gale [Tue, 23 Jan 2024 05:30:16 +0000 (05:30 +0000)] 
GH-105900: Fix `pathlib.Path.symlink_to(target_is_directory=...)` docs (#114035)

Clarify that *target_is_directory* only matters if the target doesn't
exist.

21 months agoGH-82695: Clarify `pathlib.Path.mkdir()` documentation (#114032)
Barney Gale [Tue, 23 Jan 2024 02:31:09 +0000 (02:31 +0000)] 
GH-82695: Clarify `pathlib.Path.mkdir()` documentation (#114032)

Remove a double negative in the documentation of `mkdir()`'s *exist_ok*
parameter.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
21 months agoGH-99334: Explain that `PurePath.is_relative_to()` is purely lexical. (#114031)
Barney Gale [Tue, 23 Jan 2024 01:06:44 +0000 (01:06 +0000)] 
GH-99334: Explain that `PurePath.is_relative_to()` is purely lexical. (#114031)

21 months agogh-66944: Note that the `contextlib.closing` example is for illustrative purposes...
Ville Skyttä [Tue, 23 Jan 2024 01:00:53 +0000 (03:00 +0200)] 
gh-66944: Note that the `contextlib.closing` example is for illustrative purposes (#112198)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
21 months agoDocs: minor amendments to runpy.rst (#18416)
Géry Ogam [Tue, 23 Jan 2024 00:00:26 +0000 (01:00 +0100)] 
Docs: minor amendments to runpy.rst (#18416)

- Add missing single quote in inline code
- Align parameter formatting with style guide recommendations
- Fix punctuation around parenthesised sentence

21 months agoAdd me to codeowners for hashlib & multiprocessing (#114454)
Gregory P. Smith [Mon, 22 Jan 2024 23:55:12 +0000 (15:55 -0800)] 
Add me to codeowners for hashlib & multiprocessing (#114454)

I already effectively own these. (multiprocessing reluctantly, but I've
spent enough time in the code of late, it is important, and and
championing some changes, so I may as well be looped in there).

21 months agoDocs: align usage of versionadded/versionchanged with recommended practice (#114409)
Erlend E. Aasland [Mon, 22 Jan 2024 21:40:26 +0000 (22:40 +0100)] 
Docs: align usage of versionadded/versionchanged with recommended practice (#114409)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
21 months agogh-113655: Revert extra stack reserve in PGO builds unless UseExtraStackReserve=true...
Steve Dower [Mon, 22 Jan 2024 21:19:16 +0000 (21:19 +0000)] 
gh-113655: Revert extra stack reserve in PGO builds unless UseExtraStackReserve=true (GH-114263)

21 months agogh-112532: Improve mimalloc page visiting (#114133)
Sam Gross [Mon, 22 Jan 2024 21:10:21 +0000 (16:10 -0500)] 
gh-112532: Improve mimalloc page visiting (#114133)

This adds support for visiting abandoned pages in mimalloc and improves
the performance of the page visiting code. Abandoned pages contain
memory blocks from threads that have exited. At some point, they may be
later reclaimed by other threads. We still need to visit those pages in
the free-threaded GC because they contain live objects.

This also reduces the overhead of visiting mimalloc pages:

 * Special cases for full, empty, and pages containing only a single
   block.
 * Fix free_map to use one bit instead of one byte per block.
 * Use fast integer division by a constant algorithm when computing
   block offset from block size and index.

21 months agoGH-114448: Don't sort summarize_stats.py histograms by amount of change (GH-114449)
Michael Droettboom [Mon, 22 Jan 2024 19:45:15 +0000 (14:45 -0500)] 
GH-114448: Don't sort summarize_stats.py histograms by amount of change (GH-114449)

21 months agoFix `wasi.py build` after adding the `clean` subcommand. ({GH-114447)
Brett Cannon [Mon, 22 Jan 2024 18:28:57 +0000 (10:28 -0800)] 
Fix `wasi.py build` after adding the `clean` subcommand. ({GH-114447)

21 months agogh-114257: Ignore the FileNotFound error in ctypes.util._is_elf() (GH-114394)
AN Long [Mon, 22 Jan 2024 17:15:29 +0000 (01:15 +0800)] 
gh-114257: Ignore the FileNotFound error in ctypes.util._is_elf() (GH-114394)

21 months agogh-114083: apply optimization of LOAD_CONST instructions to the whole CFG before...
Irit Katriel [Mon, 22 Jan 2024 17:12:06 +0000 (17:12 +0000)] 
gh-114083: apply optimization of LOAD_CONST instructions to the whole CFG before optimize_basic_block. (#114408)

21 months agogh-75128: Ignore EADDRNOTAVAIL error in asyncio.BaseEventLoop.create_server() (GH...
Serhiy Storchaka [Mon, 22 Jan 2024 16:40:35 +0000 (18:40 +0200)] 
gh-75128: Ignore EADDRNOTAVAIL error in asyncio.BaseEventLoop.create_server() (GH-114420)

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
21 months agogh-101100: Fix Sphinx warnings in `reference/expressions.rst` (#114194)
Hugo van Kemenade [Mon, 22 Jan 2024 16:21:14 +0000 (18:21 +0200)] 
gh-101100: Fix Sphinx warnings in `reference/expressions.rst` (#114194)

21 months agogh-114321: Expose more constants in the fcntl module (GH-114322)
Serhiy Storchaka [Mon, 22 Jan 2024 16:09:22 +0000 (18:09 +0200)] 
gh-114321: Expose more constants in the fcntl module (GH-114322)

21 months agoDocs: Fix typo in code snippet (GH-114421)
Kirill Podoprigora [Mon, 22 Jan 2024 15:56:30 +0000 (18:56 +0300)] 
Docs: Fix typo in code snippet (GH-114421)

21 months agogh-108303: Remove `Lib/test/shadowed_super.py` (#114372)
Nikita Sobolev [Mon, 22 Jan 2024 15:09:10 +0000 (18:09 +0300)] 
gh-108303: Remove `Lib/test/shadowed_super.py` (#114372)

Move code into Lib/test/test_super.py.

21 months agogh-102512: Turn _DummyThread into _MainThread after os.fork() called from a foreign...
Serhiy Storchaka [Mon, 22 Jan 2024 14:14:42 +0000 (16:14 +0200)] 
gh-102512: Turn _DummyThread into _MainThread after os.fork() called from a foreign thread (GH-113261)

Always set a _MainThread as a main thread after os.fork() is called from
a thread started not by the threading module.

A new _MainThread was already set as a new main thread after fork if
threading.current_thread() was not called for a foreign thread before fork.
Now, if it was called before fork, the implicitly created _DummyThread will
be turned into _MainThread after fork.

It fixes, in particularly, an incompatibility of _DummyThread with
the threading shutdown logic which relies on the main thread
having tstate_lock.

Co-authored-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
21 months agogh-103092: Ensure `_ctypes.c` static types are accessed via global state (#113857)
neonene [Mon, 22 Jan 2024 13:40:36 +0000 (22:40 +0900)] 
gh-103092: Ensure `_ctypes.c` static types are accessed via global state (#113857)

21 months agogh-108303: Move `smtpd` to `test.support` (#114368)
Nikita Sobolev [Mon, 22 Jan 2024 13:36:29 +0000 (16:36 +0300)] 
gh-108303: Move `smtpd` to `test.support` (#114368)

Update test_logging.py and test_smtplib.py.

21 months agogh-113796: Add more validation checks in the csv.Dialect constructor (GH-113797)
Serhiy Storchaka [Mon, 22 Jan 2024 13:34:16 +0000 (15:34 +0200)] 
gh-113796: Add more validation checks in the csv.Dialect constructor (GH-113797)

ValueError is now raised if the same character is used in different roles.

21 months agogh-113102: Fix typo in INSTRUMENTED_RESUME (GH-114349)
Guido van Rossum [Mon, 22 Jan 2024 11:56:28 +0000 (03:56 -0800)] 
gh-113102: Fix typo in INSTRUMENTED_RESUME (GH-114349)

21 months agogh-114414: Assert PyType_GetModuleByDef result in _threadmodule (#114415)
Nikita Sobolev [Mon, 22 Jan 2024 09:19:25 +0000 (12:19 +0300)] 
gh-114414: Assert PyType_GetModuleByDef result in _threadmodule (#114415)

21 months agogh-114115: Update documentation of array.array (GH-114117)
Serhiy Storchaka [Mon, 22 Jan 2024 08:42:50 +0000 (10:42 +0200)] 
gh-114115: Update documentation of array.array (GH-114117)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
21 months agogh-114328: tty cbreak mode should not alter ICRNL (#114335)
Gregory P. Smith [Sun, 21 Jan 2024 23:25:52 +0000 (15:25 -0800)] 
gh-114328: tty cbreak mode should not alter ICRNL (#114335)

The terminal CR -> NL mapping setting should be inherited in cbreak mode as OSes do not specify altering it as part of their stty cbreak mode definition.

21 months agogh-111803: Make test_deep_nesting from test_plistlib more strict (GH-114026)
Serhiy Storchaka [Sun, 21 Jan 2024 20:29:51 +0000 (22:29 +0200)] 
gh-111803: Make test_deep_nesting from test_plistlib more strict (GH-114026)

It is no longer silently passed if RecursionError was raised for low
recursion depth.

21 months agogh-114241: Fix and improve the ftplib CLI (GH-114242)
Serhiy Storchaka [Sun, 21 Jan 2024 20:16:45 +0000 (22:16 +0200)] 
gh-114241: Fix and improve the ftplib CLI (GH-114242)

* Fix writing the retrieved binary file to stdout.
* Add a newline after writing warnings to stderr.
* Fix a TypeError if the netrc file doesn't contain a host/default entry.
* Improve the usage message.

21 months agoDocs: align sqlite3 docs with versionadded/versionchanged recommendations (#114400)
Erlend E. Aasland [Sun, 21 Jan 2024 19:54:19 +0000 (20:54 +0100)] 
Docs: align sqlite3 docs with versionadded/versionchanged recommendations (#114400)

When a parameter is added to a function or method, use the 'versionchanged'
directive, not 'versionadded'.

21 months agoDocs: link to sys.stdout in ftplib docs (#114396)
Erlend E. Aasland [Sun, 21 Jan 2024 17:41:21 +0000 (18:41 +0100)] 
Docs: link to sys.stdout in ftplib docs (#114396)

21 months agogh-114384: Align sys.set_asyncgen_hooks signature in docs to reflect implementation...
Nikita Sobolev [Sun, 21 Jan 2024 12:49:49 +0000 (15:49 +0300)] 
gh-114384: Align sys.set_asyncgen_hooks signature in docs to reflect implementation (#114385)

21 months agoDocs: mark up FTP() constructor with param list (#114359)
Erlend E. Aasland [Sun, 21 Jan 2024 11:27:33 +0000 (12:27 +0100)] 
Docs: mark up FTP() constructor with param list (#114359)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
21 months agogh-80931: Skip some socket tests while hunting for refleaks on macOS (#114057)
Ronald Oussoren [Sun, 21 Jan 2024 10:25:15 +0000 (11:25 +0100)] 
gh-80931: Skip some socket tests while hunting for refleaks on macOS (#114057)

Some socket tests related to sending file descriptors cause a file descriptor leak on macOS, all of them tests that send one or more descriptors than cannot be received on the read end.  This appears to be a platform bug.

This PR skips those tests when doing a refleak test run to avoid hiding other problems.

21 months agogh-101100: Fix sphinx warnings in `Doc/c-api/memory.rst` (#114373)
Nikita Sobolev [Sun, 21 Jan 2024 09:34:43 +0000 (12:34 +0300)] 
gh-101100: Fix sphinx warnings in `Doc/c-api/memory.rst` (#114373)

21 months agoDocs: mark up the FTP debug levels as a list (#114360)
Erlend E. Aasland [Sun, 21 Jan 2024 09:19:31 +0000 (10:19 +0100)] 
Docs: mark up the FTP debug levels as a list (#114360)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
21 months agoFix the confusing "User-defined methods" reference in the datamodel (#114276)
cdzhan [Sun, 21 Jan 2024 03:45:38 +0000 (11:45 +0800)] 
Fix the confusing "User-defined methods" reference in the datamodel (#114276)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
21 months agoRemove deleted `time_hashlib.py` from `Lib/test/.ruff.toml` (#114355)
Hugo van Kemenade [Sat, 20 Jan 2024 21:10:43 +0000 (23:10 +0200)] 
Remove deleted `time_hashlib.py` from `Lib/test/.ruff.toml` (#114355)

21 months agoRemove the non-test Lib/test/time_hashlib.py. (#114354)
Gregory P. Smith [Sat, 20 Jan 2024 20:09:50 +0000 (12:09 -0800)] 
Remove the non-test Lib/test/time_hashlib.py. (#114354)

I believe I added this while chasing some performance of hash functions
when I first created hashlib.  It hasn't been used since, is frankly
trivial, and not a test.

21 months agoDocs: Add missing line continuation to FTP_TLS class docs (#114352)
Erlend E. Aasland [Sat, 20 Jan 2024 19:39:44 +0000 (20:39 +0100)] 
Docs: Add missing line continuation to FTP_TLS class docs (#114352)

Regression introduced by b1ad5a5d4.

21 months agogh-114281: Remove incorrect type hints from `asyncio.staggered` (#114282)
Nikita Sobolev [Sat, 20 Jan 2024 16:49:48 +0000 (19:49 +0300)] 
gh-114281: Remove incorrect type hints from `asyncio.staggered` (#114282)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
21 months agogh-112529: Use GC heaps for GC allocations in free-threaded builds (gh-114157)
Sam Gross [Sat, 20 Jan 2024 16:14:45 +0000 (11:14 -0500)] 
gh-112529: Use GC heaps for GC allocations in free-threaded builds (gh-114157)

* gh-112529: Use GC heaps for GC allocations in free-threaded builds

The free-threaded build's garbage collector implementation will need to
find GC objects by traversing mimalloc heaps. This hooks up the
allocation calls with the correct heaps by using a thread-local
"current_obj_heap" variable.

* Refactor out setting heap based on type

21 months agoDocs: structure the ftplib reference (#114317)
Erlend E. Aasland [Sat, 20 Jan 2024 15:06:52 +0000 (16:06 +0100)] 
Docs: structure the ftplib reference (#114317)

Introduce the following headings and subheadings:

- Reference
  * FTP objects
  * FTP_TLS objects
  * Module variables

21 months agoGH-99380: Update to Sphinx 7 (#99381)
Adam Turner [Sat, 20 Jan 2024 11:20:51 +0000 (11:20 +0000)] 
GH-99380: Update to Sphinx 7 (#99381)

21 months agogh-114332: Fix the flags reference for ``re.compile()`` (#114334)
David H. Gutteridge [Sat, 20 Jan 2024 11:17:41 +0000 (06:17 -0500)] 
gh-114332: Fix the flags reference for ``re.compile()`` (#114334)

The GH-93000 change set inadvertently caused a sentence in re.compile()
documentation to refer to details that no longer followed. Correct this
with a link to the Flags sub-subsection.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
21 months agoGH-113225: Speed up `pathlib.Path.walk(top_down=False)` (#113693)
Barney Gale [Sat, 20 Jan 2024 03:06:00 +0000 (03:06 +0000)] 
GH-113225: Speed up `pathlib.Path.walk(top_down=False)` (#113693)

Use `_make_child_entry()` rather than `_make_child_relpath()` to retrieve
path objects for directories to visit. This saves the allocation of one
path object per directory in user subclasses of `PathBase`, and avoids a
second loop.

This trick does not apply when walking top-down, because users can affect
the walk by modifying *dirnames* in-place.

A side effect of this change is that, in bottom-up mode, subdirectories of
each directory are visited in reverse order, and that this order doesn't
match that of the names in *dirnames*. I suspect this is fine as the
order is arbitrary anyway.

21 months agoGH-79634: Accept path-like objects as pathlib glob patterns. (#114017)
Barney Gale [Sat, 20 Jan 2024 02:10:25 +0000 (02:10 +0000)] 
GH-79634: Accept path-like objects as pathlib glob patterns. (#114017)

Allow `os.PathLike` objects to be passed as patterns to `pathlib.Path.glob()` and `rglob()`. (It's already possible to use them in `PurePath.match()`)

While we're in the area:

- Allow empty glob patterns in `PathBase` (but not `Path`)
- Speed up globbing in `PathBase` by generating paths with trailing slashes only as a final step, rather than for every intermediate directory.
- Simplify and speed up handling of rare patterns involving both `**` and `..` segments.

21 months agoAdd a `clean` subcommand to `Tools/wasm/wasi.py` (GH-114274)
Brett Cannon [Fri, 19 Jan 2024 19:38:52 +0000 (11:38 -0800)] 
Add a `clean` subcommand to `Tools/wasm/wasi.py` (GH-114274)

21 months agoRetain shorter tables of contents for Sphinx 5.2.3+ (#114318)
Hugo van Kemenade [Fri, 19 Jan 2024 18:52:42 +0000 (20:52 +0200)] 
Retain shorter tables of contents for Sphinx 5.2.3+ (#114318)

Disable toc_object_entries, new in Sphinx 5.2.3

21 months agogh-114265: move line number propagation before cfg optimization, remove guarantee_lin...
Irit Katriel [Fri, 19 Jan 2024 14:49:26 +0000 (14:49 +0000)] 
gh-114265: move line number propagation before cfg optimization, remove guarantee_lineno_for_exits (#114267)

21 months agogh-114275: Skip doctests that use `asyncio` in `test_pdb` for WASI builds (#114309)
Nikita Sobolev [Fri, 19 Jan 2024 13:00:34 +0000 (16:00 +0300)] 
gh-114275: Skip doctests that use `asyncio` in `test_pdb` for WASI builds (#114309)

21 months agogh-113884: Refactor `queue.SimpleQueue` to use a ring buffer to store items (#114259)
mpage [Fri, 19 Jan 2024 12:17:51 +0000 (04:17 -0800)] 
gh-113884: Refactor `queue.SimpleQueue` to use a ring buffer to store items (#114259)

Use a ring buffer instead of a Python list in order to simplify the
process of making queue.SimpleQueue thread-safe in free-threaded
builds. The ring buffer implementation has no places where critical
sections may be released.

21 months agogh-114286: Fix `maybe-uninitialized` warning in `Modules/_io/fileio.c` (GH-114287)
Nikita Sobolev [Fri, 19 Jan 2024 10:25:05 +0000 (13:25 +0300)] 
gh-114286: Fix `maybe-uninitialized` warning in `Modules/_io/fileio.c` (GH-114287)

21 months agogh-111968: Fix --without-freelists build (gh-114270)
Donghee Na [Thu, 18 Jan 2024 23:25:13 +0000 (08:25 +0900)] 
gh-111968: Fix --without-freelists build (gh-114270)

21 months agogh-112087: Remove duplicated critical_section (gh-114268)
Donghee Na [Thu, 18 Jan 2024 23:03:28 +0000 (08:03 +0900)] 
gh-112087: Remove duplicated critical_section (gh-114268)

21 months agogh-114123: Migrate docstring from _csv to csv (#114124)
Skip Montanaro [Thu, 18 Jan 2024 22:18:42 +0000 (16:18 -0600)] 
gh-114123: Migrate docstring from _csv to csv (#114124)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
21 months agogh-112092: clarify unstable ABI recompilation requirements (#112093)
DerSchinken [Thu, 18 Jan 2024 20:04:40 +0000 (21:04 +0100)] 
gh-112092: clarify unstable ABI recompilation requirements (#112093)

Use different versions in the examples for when extensions do and do not need to be recompiled to make the examples easier to understand.

21 months agogh-111968: Use per-thread freelists for generator in free-threading (gh-114189)
Donghee Na [Thu, 18 Jan 2024 18:15:00 +0000 (03:15 +0900)] 
gh-111968: Use per-thread freelists for generator in free-threading (gh-114189)

21 months agogh-114087: Speed up dataclasses._asdict_inner (#114088)
keithasaurus [Thu, 18 Jan 2024 16:03:20 +0000 (08:03 -0800)] 
gh-114087: Speed up dataclasses._asdict_inner (#114088)

21 months agogh-114198: Rename dataclass __replace__ argument to 'self' (gh-114251)
Phillip Schanely [Thu, 18 Jan 2024 16:01:17 +0000 (11:01 -0500)] 
gh-114198: Rename dataclass __replace__ argument to 'self' (gh-114251)

This change renames the dataclass __replace__ method's first argument
name from 'obj' to 'self'.

21 months agogh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` ...
Nikita Sobolev [Thu, 18 Jan 2024 15:58:11 +0000 (18:58 +0300)] 
gh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` (#112109)

Co-authored-by: Brett Cannon <brett@python.org>
21 months agoDelete unused macro (GH-114238)
Mark Shannon [Thu, 18 Jan 2024 15:49:50 +0000 (15:49 +0000)] 
Delete unused macro (GH-114238)

21 months agogh-110345: show Tcl/Tk patchlevel in `tkinter._test()` (GH-110350)
Christopher Chavez [Thu, 18 Jan 2024 15:46:58 +0000 (09:46 -0600)] 
gh-110345: show Tcl/Tk patchlevel in `tkinter._test()` (GH-110350)

21 months agogh-103092: Convert some `_ctypes` metatypes to heap types (GH-113620)
AN Long [Thu, 18 Jan 2024 15:30:27 +0000 (23:30 +0800)] 
gh-103092: Convert some `_ctypes` metatypes to heap types (GH-113620)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
21 months agogh-114050: Fix crash when more than two arguments are passed to int() (GH-114067)
kcatss [Thu, 18 Jan 2024 11:27:44 +0000 (20:27 +0900)] 
gh-114050: Fix crash when more than two arguments are passed to int() (GH-114067)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
21 months agogh-104522: Fix test_subprocess failure when build Python in the root home directory...
Serhiy Storchaka [Thu, 18 Jan 2024 10:52:59 +0000 (12:52 +0200)] 
gh-104522: Fix test_subprocess failure when build Python in the root home directory (GH-114236)

* gh-104522: Fix test_subprocess failure when build Python in the root home directory

EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.

21 months agogh-114231: Fix indentation in enum.rst (#114232)
Miyashita Yosuke [Thu, 18 Jan 2024 09:23:15 +0000 (18:23 +0900)] 
gh-114231: Fix indentation in enum.rst (#114232)

21 months agogh-96905: In IDLE code, stop redefining built-ins 'dict' and 'object' (#114227)
Terry Jan Reedy [Thu, 18 Jan 2024 04:39:12 +0000 (23:39 -0500)] 
gh-96905: In IDLE code, stop redefining built-ins 'dict' and 'object' (#114227)

Prefix 'dict' with 'o', 'g', or 'l' for 'object', 'global', or 'local'.
Suffix 'object' with '_'.

21 months agogh-114211: Update EmailMessage doc about ordered keys (#114224)
Terry Jan Reedy [Thu, 18 Jan 2024 02:25:22 +0000 (21:25 -0500)] 
gh-114211: Update EmailMessage doc about ordered keys (#114224)

Ordered keys are no longer unlike 'real dict's.

21 months agogh-113205: test_multiprocessing.test_terminate: Test the API on threadpools (#114186)
Petr Viktorin [Thu, 18 Jan 2024 01:15:29 +0000 (02:15 +0100)] 
gh-113205: test_multiprocessing.test_terminate: Test the API on threadpools (#114186)

gh-113205: test_multiprocessing.test_terminate: Test the API works on threadpools

Threads can't be forced to terminate (without potentially corrupting too much
state), so the  expected behaviour of `ThreadPool.terminate` is to wait for
the currently executing tasks to finish.

The entire test was skipped in GH-110848 (0e9c364f4ac18a2237bdbac702b96bcf8ef9cb09).
Instead of skipping it entirely, we should ensure the API eventually succeeds:
use a shorter timeout.

For the record: on my machine, when the test is un-skipped, the task manages to
start in about 1.5% cases.

21 months agogh-104522: Fix OSError raised when run a subprocess (#114195)
Serhiy Storchaka [Thu, 18 Jan 2024 00:52:42 +0000 (02:52 +0200)] 
gh-104522: Fix OSError raised when run a subprocess (#114195)

Only set filename to cwd if it was caused by failed chdir(cwd).

_fork_exec() now returns "noexec:chdir" for failed chdir(cwd).

Co-authored-by: Robert O'Shea <PurityLake@users.noreply.github.com>
21 months agogh-114149: [Enum] revert #114160 and add more tuple-subclass tests (GH-114215)
Ethan Furman [Thu, 18 Jan 2024 00:31:00 +0000 (16:31 -0800)] 
gh-114149: [Enum] revert #114160 and add more tuple-subclass tests (GH-114215)

This reverts commit 05e142b1543eb9662d6cc33722e7e16250c9219f.

21 months agogh-112984: Fix test_ctypes.test_loading.test_load_dll_with_flags when directory name...
Steve Dower [Thu, 18 Jan 2024 00:26:31 +0000 (00:26 +0000)] 
gh-112984: Fix test_ctypes.test_loading.test_load_dll_with_flags when directory name includes a dot (GH-114217)

21 months agogh-112984 Update Windows build and installer for free-threaded builds (GH-113129)
Steve Dower [Wed, 17 Jan 2024 21:52:23 +0000 (21:52 +0000)] 
gh-112984 Update Windows build and installer for free-threaded builds (GH-113129)

21 months agogh-38807: Fix race condition in Lib/trace.py (GH-110143)
buermarc [Wed, 17 Jan 2024 20:02:14 +0000 (21:02 +0100)] 
gh-38807: Fix race condition in Lib/trace.py (GH-110143)

Instead of checking if a directory does not exist and thereafter
creating it, directly call os.makedirs() with the exist_ok=True.

21 months agoFix typo in tkinter.ttk.rst (GH-106157)
Christophe Nanteuil [Wed, 17 Jan 2024 18:23:25 +0000 (19:23 +0100)] 
Fix typo in tkinter.ttk.rst (GH-106157)

21 months agogh-105102: Fix nested unions in structures when the system byteorder is the opposite...
Sheidan [Wed, 17 Jan 2024 18:20:39 +0000 (19:20 +0100)] 
gh-105102: Fix nested unions in structures when the system byteorder is the opposite (GH-105106)

21 months agogh-114149: [Enum] fix tuple subclass handling when using custom __new__ (GH-114160)
Ethan Furman [Wed, 17 Jan 2024 17:47:11 +0000 (09:47 -0800)] 
gh-114149: [Enum] fix tuple subclass handling when using custom __new__ (GH-114160)

21 months agogh-114070: fix token reference warnings in expressions.rst (#114169)
Sergey B Kirpichev [Wed, 17 Jan 2024 16:39:50 +0000 (19:39 +0300)] 
gh-114070: fix token reference warnings in expressions.rst (#114169)

21 months agogh-114178: Fix generate_sbom.py for out-of-tree builds (#114179)
Erlend E. Aasland [Wed, 17 Jan 2024 16:25:39 +0000 (17:25 +0100)] 
gh-114178: Fix generate_sbom.py for out-of-tree builds (#114179)

21 months agoMerge branch 'main' of https://github.com/python/cpython
Thomas Wouters [Wed, 17 Jan 2024 15:19:08 +0000 (16:19 +0100)] 
Merge branch 'main' of https://github.com/python/cpython

21 months agoPost 3.13.0a3
Thomas Wouters [Wed, 17 Jan 2024 15:17:42 +0000 (16:17 +0100)] 
Post 3.13.0a3

21 months agogh-112343: pdb: Use tokenize to replace convenience variables (#112380)
Tian Gao [Wed, 17 Jan 2024 14:50:31 +0000 (06:50 -0800)] 
gh-112343: pdb: Use tokenize to replace convenience variables (#112380)

21 months agogh-111301: Advertise importlib methods removal in What's new in Python 3.12 (GH-111630)
Karolina Surma [Wed, 17 Jan 2024 14:25:42 +0000 (15:25 +0100)] 
gh-111301: Advertise importlib methods removal in What's new in Python 3.12 (GH-111630)

21 months agogh-104282: Fix null pointer dereference in `lzma._decode_filter_properties` (GH-104283)
Radislav Chugunov [Wed, 17 Jan 2024 13:15:44 +0000 (16:15 +0300)] 
gh-104282: Fix null pointer dereference in `lzma._decode_filter_properties` (GH-104283)

21 months agoPython 3.13.0a3 v3.13.0a3
Thomas Wouters [Wed, 17 Jan 2024 12:09:05 +0000 (13:09 +0100)] 
Python 3.13.0a3

21 months agogh-86179: Skip test case that fails on POSIX with unversioned binary (GH-114136)
Steve Dower [Wed, 17 Jan 2024 11:33:59 +0000 (11:33 +0000)] 
gh-86179: Skip test case that fails on POSIX with unversioned binary (GH-114136)

21 months agogh-72284: Revise lists in IDLE doc (#114174)
Terry Jan Reedy [Wed, 17 Jan 2024 07:52:32 +0000 (02:52 -0500)] 
gh-72284: Revise lists in IDLE doc  (#114174)

Tkinter is a fact, not necessarily a feature.

Reorganize editor key bindings in a logical order
and remove those that do not work, at least on Windows.

Improve shell bindings list.

21 months agogh-81479: For Help => IDLE Doc, stop double-spacing some lists. (#114168)
Terry Jan Reedy [Wed, 17 Jan 2024 05:24:59 +0000 (00:24 -0500)] 
gh-81479: For Help => IDLE Doc, stop double-spacing some lists. (#114168)

This matches Firefox format.  Edge double-spaces non-simple
list but I think it looks worse.

21 months agogh-112043: Align concurrent.futures.Executor.map docs with implementation (#114153)
Erlend E. Aasland [Wed, 17 Jan 2024 01:31:16 +0000 (02:31 +0100)] 
gh-112043: Align concurrent.futures.Executor.map docs with implementation (#114153)

The first parameter is named 'fn', not 'func'.

21 months agogh-88531 Fix dataclass __post_init__/__init__ interplay documentation (gh-107404)
Steffen Zeile [Wed, 17 Jan 2024 01:17:34 +0000 (02:17 +0100)] 
gh-88531 Fix dataclass __post_init__/__init__ interplay documentation (gh-107404)

* Simplify __post_init__ example usage. It applies to all base classes, not just dataclasses.

21 months agogh-106293: Fix typos in Objects/object_layout.md (#106294)
Mano Sriram [Tue, 16 Jan 2024 23:11:15 +0000 (04:41 +0530)] 
gh-106293: Fix typos in Objects/object_layout.md (#106294)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>