summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gh-112529: Implement GC for free-threaded builds (#114262)Sam Gross2024-01-2518-22/+1952
| | | | | | | * gh-112529: Implement GC for free-threaded builds This implements a mark and sweep GC for the free-threaded builds of CPython. The implementation relies on mimalloc to find GC tracked objects (i.e., "containers").
* gh-112075: Add try-incref functions from nogil branch for use in dict thread ↵Dino Viehland2024-01-251-0/+136
| | | | | | | | | | | | | | | | | | | | safety (#114512) * Bring in a subset of biased reference counting: https://github.com/colesbury/nogil/commit/b6b12a9a94e The NoGIL branch has functions for attempting to do an incref on an object which may or may not be in flight. This just brings those functions over so that they will be usable from in the dict implementation to get items w/o holding a lock. There's a handful of small simple modifications: Adding inline to the force inline functions to avoid a warning, and switching from _Py_ALWAYS_INLINE to Py_ALWAYS_INLINE as that's available Remove _Py_REF_LOCAL_SHIFT as it doesn't exist yet (and is currently 0 in the 3.12 nogil branch anyway) ob_ref_shared is currently Py_ssize_t and not uint32_t, so use that _PY_LIKELY doesn't exist, so drop it _Py_ThreadLocal becomes _Py_IsOwnedByCurrentThread Add '_PyInterpreterState_GET()' to _Py_IncRefTotal calls. Co-Authored-By: Sam Gross <colesbury@gmail.com>
* gh-111051: Check if file is modifed during debugging in `pdb` (#111052)Tian Gao2024-01-253-0/+103
|
* Doc/library/sys.monitoring.rst: remove contradictory paragraph. (GH-113619)Ned Batchelder2024-01-251-3/+0
|
* gh-77465: Increase test coverage for the numbers module (GH-111738)AN Long2024-01-251-1/+157
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-114265: remove i_loc_propagated, jump threading does not consider line ↵Irit Katriel2024-01-252-42/+49
| | | | numbers anymore (#114535)
* gh-114312: Collect stats for unlikely events (GH-114493)Michael Droettboom2024-01-2511-1/+199
|
* gh-114272: Fix or skip tests that fail due to spaces in paths (GH-114451)Steve Dower2024-01-254-25/+45
|
* gh-100107: Make py.exe launcher ignore app aliases that launch Microsoft ↵Vincent Cunningham2024-01-252-0/+70
| | | | Store (GH-114358)
* gh-108731: Add description of __slots__ to MemberDescriptorType docs (GH-108745)plokmijnuhby2024-01-241-0/+4
|
* Update outdated comment in ``Python/bytecodes.c`` (#114522)Kirill Podoprigora2024-01-241-2/+2
|
* GH-112354: `END_FOR` instruction to only pop one value. (GH-114247)Mark Shannon2024-01-2416-184/+238
| | | | * Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.
* Docs: mark up the FTP_TLS() docs with param list (#114510)Erlend E. Aasland2024-01-241-10/+46
| | | Also turn sentence about prot_p() into a note.
* gh-104360: remove reference to removed module-level wrap_socket (GH-104361)Thomas Grainger2024-01-241-5/+1
| | | | * remove reference to removed module-level wrap_socket * drive by typo fix
* gh-101100: Fix Sphinx warnings in `c-api/structures.rst` (#113564)Hugo van Kemenade2024-01-242-10/+10
| | | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-101100: Fix sphinx warnings in `concurrent.futures.rst` (#114521)Nikita Sobolev2024-01-242-21/+22
|
* GH-113710: Add a tier 2 peephole optimization pass. (GH-114487)Mark Shannon2024-01-247-6/+66
| | | | | * Convert _LOAD_CONST to inline versions * Remove PEP 523 checks
* gh-101100: Fix sphinx warnings in `asyncio-task.rst` (#114469)Nikita Sobolev2024-01-242-18/+16
| | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-113205: test_multiprocessing.test_terminate: Give tasks a chance to start ↵Serhiy Storchaka2024-01-241-0/+1
| | | | (GH-114249)
* Fix a typo in the contextlib documentation (#114507)Daniel Hollas2024-01-241-1/+1
|
* GH-114456: lower the recursion limit under WASI for debug builds (GH-114457)Brett Cannon2024-01-234-6/+13
| | | Testing under wasmtime 16.0.0 w/ code from https://github.com/python/cpython/issues/114413 is how the value was found.
* gh-112075: Adapt more dict methods to Argument Clinic (#114256)Dino Viehland2024-01-232-81/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move more dict objects to argument clinic * Improve doc strings * More doc string improvements * Update Objects/dictobject.c Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> * Update Objects/dictobject.c Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> * Update Objects/dictobject.c Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> * Update Objects/dictobject.c Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> * Update Objects/dictobject.c Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> * Update Objects/dictobject.c Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> * Update Objects/dictobject.c Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> --------- Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-114492: Initialize struct termios before calling tcgetattr() (GH-114495)Serhiy Storchaka2024-01-232-0/+4
| | | On Alpine Linux it could leave some field non-initialized.
* gh-101438: Avoid reference cycle in ElementTree.iterparse. (GH-114269)Sam Gross2024-01-232-10/+21
| | | | | | The iterator returned by ElementTree.iterparse() may hold on to a file descriptor. The reference cycle prevented prompt clean-up of the file descriptor if the returned iterator was not exhausted.
* Docs: use placeholders in dbm flag param docs (#114482)Erlend E. Aasland2024-01-231-60/+43
| | | | Also correct the default flag param for dbm.dumb.open(); it's 'c', not 'r'.
* gh-113884: Make queue.SimpleQueue thread-safe when the GIL is disabled (#114161)mpage2024-01-233-90/+137
| | | | | | | * use the ParkingLot API to manage waiting threads * use Argument Clinic's critical section directive to protect queue methods * remove unnecessary overflow check Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-111964: Implement stop-the-world pauses (gh-112471)Sam Gross2024-01-2310-29/+336
| | | | | | | | | | | | | | | | | 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.
* gh-112984: Fix link error on free-threaded Windows build (GH-114455)Sam Gross2024-01-231-0/+3
| | | | | | 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.
* gh-108303: Move `.whl` test files to `Lib/test/wheeldata/` (#114343)Nikita Sobolev2024-01-234-1/+4
|
* Docs: mark up FTP.connect() and FTP.login() with param lists (#114395)Erlend E. Aasland2024-01-231-33/+70
| | | | | | 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>
* Docs: mark up FTP.retrbinary and FTP.storbinary with param lists (#114399)Erlend E. Aasland2024-01-232-17/+46
| | | Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-114423: Remove DummyThread from threading._active when thread dies ↵Fabio Zadrozny2024-01-233-28/+76
| | | | (GH-114424)
* gh-101100: Fix sphinx warnings in `Doc/library/locale.rst` (#114425)Nikita Sobolev2024-01-232-14/+48
| | | | | * gh-101100: Fix sphinx warnings in `Doc/library/locale.rst` * Remove `/` from signatures
* gh-113317: Don't use global clinic instance in bad_argument() (#114330)Erlend E. Aasland2024-01-231-12/+11
| | | | | | | 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.
* gh-89427: Provide the original prompt value for VIRTUAL_ENV_PROMPT (GH-106726)Jim Porter2024-01-236-10/+9
| | | | | | | | | | 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.
* GH-105900: Fix `pathlib.Path.symlink_to(target_is_directory=...)` docs (#114035)Barney Gale2024-01-231-3/+7
| | | | Clarify that *target_is_directory* only matters if the target doesn't exist.
* GH-82695: Clarify `pathlib.Path.mkdir()` documentation (#114032)Barney Gale2024-01-231-3/+3
| | | | | | 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>
* GH-99334: Explain that `PurePath.is_relative_to()` is purely lexical. (#114031)Barney Gale2024-01-231-0/+7
|
* gh-66944: Note that the `contextlib.closing` example is for illustrative ↵Ville Skyttä2024-01-231-0/+8
| | | | | purposes (#112198) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Docs: minor amendments to runpy.rst (#18416)Géry Ogam2024-01-231-20/+20
| | | | | - Add missing single quote in inline code - Align parameter formatting with style guide recommendations - Fix punctuation around parenthesised sentence
* Add me to codeowners for hashlib & multiprocessing (#114454)Gregory P. Smith2024-01-221-7/+10
| | | | | 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).
* Docs: align usage of versionadded/versionchanged with recommended practice ↵Erlend E. Aasland2024-01-2228-173/+172
| | | | | | (#114409) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-113655: Revert extra stack reserve in PGO builds unless ↵Steve Dower2024-01-222-2/+2
| | | | UseExtraStackReserve=true (GH-114263)
* gh-112532: Improve mimalloc page visiting (#114133)Sam Gross2024-01-223-34/+134
| | | | | | | | | | | | | | | 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.
* GH-114448: Don't sort summarize_stats.py histograms by amount of change ↵Michael Droettboom2024-01-221-4/+7
| | | | (GH-114449)
* Fix `wasi.py build` after adding the `clean` subcommand. ({GH-114447)Brett Cannon2024-01-221-1/+2
|
* gh-114257: Ignore the FileNotFound error in ctypes.util._is_elf() (GH-114394)AN Long2024-01-223-2/+10
|
* gh-114083: apply optimization of LOAD_CONST instructions to the whole CFG ↵Irit Katriel2024-01-223-143/+191
| | | | before optimize_basic_block. (#114408)
* gh-75128: Ignore EADDRNOTAVAIL error in ↵Serhiy Storchaka2024-01-222-3/+19
| | | | | asyncio.BaseEventLoop.create_server() (GH-114420) Co-authored-by: Antoine Pitrou <pitrou@free.fr>
* gh-101100: Fix Sphinx warnings in `reference/expressions.rst` (#114194)Hugo van Kemenade2024-01-222-27/+26
|